Fixed vim config
This commit is contained in:
parent
af90c6913a
commit
198307c2dc
3
vim/coc-settings.json
Normal file
3
vim/coc-settings.json
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"diagnostic.checkCurrentLine": true
|
||||||
|
}
|
54
vim/init.vim
54
vim/init.vim
@ -24,58 +24,38 @@ noremap <Right> <Nop>
|
|||||||
nnoremap <space> <nop>
|
nnoremap <space> <nop>
|
||||||
let mapleader=" "
|
let mapleader=" "
|
||||||
|
|
||||||
" FZF key bindings
|
|
||||||
noremap <C-p> <cmd>Files<cr>
|
|
||||||
noremap <C-b> <cmd>Buffers<cr>
|
|
||||||
|
|
||||||
call plug#begin('~/.vim/plugged')
|
call plug#begin('~/.vim/plugged')
|
||||||
" Syntax correcting and autocomplete for nvim
|
" Syntax highlighting and autocomplete for nvim
|
||||||
Plug 'neovim/nvim-lspconfig'
|
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||||
Plug 'nvim-lua/completion-nvim'
|
|
||||||
|
|
||||||
" FZF
|
" FZF for better file jumping.
|
||||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||||
Plug 'junegunn/fzf.vim'
|
Plug 'junegunn/fzf.vim'
|
||||||
Plug 'stsewd/fzf-checkout.vim'
|
|
||||||
|
|
||||||
" Theme and Syntax Highlighting
|
" Theme and Syntax Highlighting
|
||||||
Plug 'morhetz/gruvbox'
|
Plug 'morhetz/gruvbox'
|
||||||
Plug 'bfrg/vim-cpp-modern'
|
|
||||||
|
|
||||||
" For vim practice
|
|
||||||
Plug 'ThePrimeagen/vim-be-good'
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
" Set colorscheme
|
" Set colorscheme
|
||||||
let g:gruvbox_contrast_dark = 'hard'
|
let g:gruvbox_contrast_dark = 'hard'
|
||||||
|
|
||||||
if exists('+termgicolors')
|
" Transparent background with gruvbox theme
|
||||||
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
|
|
||||||
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
|
|
||||||
endif
|
|
||||||
|
|
||||||
colorscheme gruvbox
|
colorscheme gruvbox
|
||||||
set background=dark
|
set background=dark
|
||||||
hi Normal guibg=NONE ctermbg=NONE
|
hi Normal guibg=NONE ctermbg=NONE
|
||||||
|
|
||||||
" Load the clangd server as the interpreter
|
" FZF key bindings
|
||||||
set completeopt=menuone,noinsert,noselect
|
nnoremap <leader>ff <cmd>Files<cr>
|
||||||
let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy']
|
nnoremap <leader>fg <cmd>Rg<cr>
|
||||||
|
nnoremap <leader>fb <cmd>Buffers<cr>
|
||||||
|
|
||||||
" Language server for nvim-lsp
|
" use <tab> for trigger completion and navigate to the next complete item
|
||||||
|
function! s:check_back_space() abort
|
||||||
|
let col = col('.') - 1
|
||||||
|
return !col || getline('.')[col - 1] =~ '\s'
|
||||||
|
endfunction
|
||||||
|
|
||||||
lua << EOF
|
inoremap <silent><expr> <Tab>
|
||||||
require'lspconfig'.clangd.setup{
|
\ pumvisible() ? "\<C-n>" :
|
||||||
on_attach=require'completion'.on_attach,
|
\ <SID>check_back_space() ? "\<Tab>" :
|
||||||
filetypes = {"c", "cpp", "objc", "objcpp"}
|
\ coc#refresh()
|
||||||
}
|
|
||||||
require'lspconfig'.pylsp.setup{
|
|
||||||
on_attach=require'completion'.on_attach,
|
|
||||||
cmd = {"pylsp"},
|
|
||||||
filetypes = {"python", "py"}
|
|
||||||
}
|
|
||||||
require'lspconfig'.tsserver.setup{
|
|
||||||
on_attach=require'completion'.on_attach,
|
|
||||||
root_dir = function() return vim.loop.cwd() end
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user