Update init.vim
This commit is contained in:
parent
be50c7ee96
commit
61988e3afb
128
nvim/init.vim
128
nvim/init.vim
@ -1,6 +1,6 @@
|
|||||||
let mapleader=" "
|
let mapleader=" "
|
||||||
syntax on
|
|
||||||
set list
|
set list
|
||||||
|
syntax on
|
||||||
let g:html_indent_script1 = "inc"
|
let g:html_indent_script1 = "inc"
|
||||||
let g:html_indent_style1 = "inc"
|
let g:html_indent_style1 = "inc"
|
||||||
set relativenumber
|
set relativenumber
|
||||||
@ -24,33 +24,35 @@ set updatetime=50
|
|||||||
set shortmess+=c
|
set shortmess+=c
|
||||||
|
|
||||||
call plug#begin('~/.vim/plugged')
|
call plug#begin('~/.vim/plugged')
|
||||||
Plug 'gruvbox-community/gruvbox'
|
Plug 'gruvbox-community/gruvbox'
|
||||||
" Plug 'colepeters/spacemacs-theme.vim'
|
" Plug 'colepeters/spacemacs-theme.vim'
|
||||||
Plug 'sainnhe/gruvbox-material'
|
Plug 'sainnhe/gruvbox-material'
|
||||||
" Plug 'phanviet/vim-monokai-pro'
|
" Plug 'phanviet/vim-monokai-pro'
|
||||||
Plug 'vim-airline/vim-airline'
|
Plug 'vim-airline/vim-airline'
|
||||||
Plug 'flazz/vim-colorschemes'
|
Plug 'flazz/vim-colorschemes'
|
||||||
Plug 'ap/vim-css-color'
|
Plug 'ap/vim-css-color'
|
||||||
Plug 'airblade/vim-rooter'
|
Plug 'airblade/vim-rooter'
|
||||||
|
|
||||||
" Telescope
|
" Telescope
|
||||||
Plug 'nvim-lua/plenary.nvim'
|
Plug 'nvim-lua/plenary.nvim'
|
||||||
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.2' }
|
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.2' }
|
||||||
Plug 'ThePrimeagen/harpoon'
|
Plug 'ThePrimeagen/harpoon'
|
||||||
|
Plug 'nvim-telescope/telescope-live-grep-args.nvim'
|
||||||
|
|
||||||
" LSP Support
|
" LSP Support
|
||||||
Plug 'neovim/nvim-lspconfig' " Required
|
Plug 'neovim/nvim-lspconfig' " Required
|
||||||
Plug 'williamboman/mason.nvim', " Optional
|
Plug 'williamboman/mason.nvim', " Optional
|
||||||
Plug 'williamboman/mason-lspconfig.nvim' " Optional
|
Plug 'williamboman/mason-lspconfig.nvim' " Optional
|
||||||
|
|
||||||
" Autocompletion
|
" Autocompletion
|
||||||
Plug 'hrsh7th/nvim-cmp' " Required
|
Plug 'hrsh7th/nvim-cmp' " Required
|
||||||
Plug 'hrsh7th/cmp-nvim-lsp' " Required
|
Plug 'hrsh7th/cmp-nvim-lsp' " Required
|
||||||
Plug 'L3MON4D3/LuaSnip' " Required
|
Plug 'L3MON4D3/LuaSnip' " Required
|
||||||
|
|
||||||
Plug 'VonHeikemen/lsp-zero.nvim', {'branch': 'v2.x'}
|
Plug 'stevearc/oil.nvim'
|
||||||
|
Plug 'VonHeikemen/lsp-zero.nvim', {'branch': 'v2.x'}
|
||||||
|
|
||||||
Plug 'praem90/nvim-phpcsf'
|
Plug 'praem90/nvim-phpcsf'
|
||||||
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
@ -58,13 +60,20 @@ let g:nvim_phpcs_config_phpcs_path = '/var/www/html/praeconis/vendor/bin/phpcs'
|
|||||||
let g:nvim_phpcs_config_phpcbf_path = '/var/www/html/praeconis/vendor/bin/phpcbf'
|
let g:nvim_phpcs_config_phpcbf_path = '/var/www/html/praeconis/vendor/bin/phpcbf'
|
||||||
let g:nvim_phpcs_config_phpcs_standard = 'Drupal' " or path to your ruleset phpcs.xml
|
let g:nvim_phpcs_config_phpcs_standard = 'Drupal' " or path to your ruleset phpcs.xml
|
||||||
augroup PHBSCF
|
augroup PHBSCF
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufWritePost,BufReadPost,InsertLeave *.php :lua require'phpcs'.cs()
|
autocmd BufWritePost,BufReadPost,InsertLeave *.php :lua require'phpcs'.cs()
|
||||||
autocmd BufWritePost *.php :lua require'phpcs'.cbf()
|
autocmd BufWritePost *.php :lua require'phpcs'.cbf()
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
|
|
||||||
|
nnoremap <Esc> :noh<CR>
|
||||||
|
noremap <C-i> <Nop>
|
||||||
|
|
||||||
|
" Remapper Ctrl+O pour aller au fichier précédent dans l'historique
|
||||||
|
nnoremap <C-o> :bprevious<CR>
|
||||||
|
|
||||||
|
" Remapper Ctrl+I pour aller au fichier suivant dans l'historique
|
||||||
|
nnoremap <C-i> :bnext<CR>
|
||||||
" Theme
|
" Theme
|
||||||
let g:gruvbox_invert_selection='0'
|
let g:gruvbox_invert_selection='0'
|
||||||
set background=dark
|
set background=dark
|
||||||
@ -74,7 +83,7 @@ let g:rooter_patterns = ['Makefile', '*.sln', 'build/env.sh', 'deploy.sh']
|
|||||||
|
|
||||||
" Telescope
|
" Telescope
|
||||||
nnoremap <leader>ff <cmd>Telescope find_files<cr>
|
nnoremap <leader>ff <cmd>Telescope find_files<cr>
|
||||||
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
|
nnoremap <leader>fg <cmd>lua require('telescope').extensions.live_grep_args.live_grep_args()<cr>
|
||||||
nnoremap <leader>fb <cmd>Telescope buffers<cr>
|
nnoremap <leader>fb <cmd>Telescope buffers<cr>
|
||||||
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
|
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
|
||||||
|
|
||||||
@ -83,16 +92,28 @@ nnoremap <leader>a <cmd>lua require("harpoon.mark").add_file()<cr>
|
|||||||
nnoremap <leader><leader> <cmd>:lua require("harpoon.ui").toggle_quick_menu()<cr>
|
nnoremap <leader><leader> <cmd>:lua require("harpoon.ui").toggle_quick_menu()<cr>
|
||||||
|
|
||||||
" Fichier
|
" Fichier
|
||||||
nnoremap <C-p> :Explore %:h<CR>
|
" Fonction pour ouvrir Dolphin dans le répertoire du fichier courant
|
||||||
|
function! OpenDolphin()
|
||||||
|
let l:current_file = expand('%:p')
|
||||||
|
let l:current_directory = fnamemodify(l:current_file, ':p:h')
|
||||||
|
silent execute "!dolphin" shellescape(l:current_directory)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Associez la fonction OpenDolphin à la combinaison de touches Ctrl+P
|
||||||
|
nnoremap <C-S-P> :call OpenDolphin()<CR>
|
||||||
|
|
||||||
lua<<OEF
|
lua<<OEF
|
||||||
|
|
||||||
|
require("oil").setup()
|
||||||
|
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
|
||||||
|
|
||||||
local lsp = require('lsp-zero').preset({})
|
local lsp = require('lsp-zero').preset({})
|
||||||
|
|
||||||
|
|
||||||
lsp.on_attach(function(client, bufnr)
|
lsp.on_attach(function(client, bufnr)
|
||||||
-- see :help lsp-zero-keybindings
|
-- see :help lsp-zero-keybindings
|
||||||
-- to learn the available actions
|
-- to learn the available actions
|
||||||
lsp.default_keymaps({buffer = bufnr})
|
lsp.default_keymaps({buffer = bufnr})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
lsp.setup()
|
lsp.setup()
|
||||||
@ -102,29 +123,30 @@ local cmp = require('cmp')
|
|||||||
local cmp_action = require('lsp-zero').cmp_action()
|
local cmp_action = require('lsp-zero').cmp_action()
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
mapping = {
|
mapping = {
|
||||||
-- `Enter` key to confirm completion
|
-- `Enter` key to confirm completion
|
||||||
['<CR>'] = cmp.mapping.confirm({select = false}),
|
['<CR>'] = cmp.mapping.confirm({select = false}),
|
||||||
|
|
||||||
-- Ctrl+Space to trigger completion menu
|
-- Ctrl+Space to trigger completion menu
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
|
|
||||||
-- Navigate between snippet placeholder
|
-- Navigate between snippet placeholder
|
||||||
['<C-f>'] = cmp_action.luasnip_jump_forward(),
|
['<C-f>'] = cmp_action.luasnip_jump_forward(),
|
||||||
['<C-b>'] = cmp_action.luasnip_jump_backward(),
|
['<C-b>'] = cmp_action.luasnip_jump_backward(),
|
||||||
['<Tab>'] = function(fallback)
|
['<Tab>'] = function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
['<S-Tab>'] = function(fallback)
|
['<S-Tab>'] = function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user