Created
April 20, 2023 07:54
-
-
Save me97esn/f7e0edccbd7327db247ba4f95d5f7e9c to your computer and use it in GitHub Desktop.
Vim config ~/.config/nvim/init.vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Specify a directory for plugins | |
" - For Neovim: stdpath('data') . '/plugged' | |
" - Avoid using standard Vim directory names like 'plugin' | |
call plug#begin('~/.vim/plugged') | |
Plug 'neoclide/coc.nvim', {'branch': 'release'} | |
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } | |
Plug 'junegunn/fzf.vim' | |
Plug 'tpope/vim-commentary' | |
Plug 'https://github.com/github/copilot.vim.git' | |
Plug 'dense-analysis/ale' | |
Plug 'w0rp/ale' | |
" Initialize plugin system | |
call plug#end() | |
" use <tab> for trigger completion and navigate to the next complete item | |
function! CheckBackspace() abort | |
let col = col('.') - 1 | |
return !col || getline('.')[col - 1] =~# '\s' | |
endfunction | |
inoremap <silent><expr> <Tab> | |
\ coc#pum#visible() ? coc#pum#next(1) : | |
\ CheckBackspace() ? "\<Tab>" : | |
\ coc#refresh() | |
inoremap <silent><expr> <S-Tab> | |
\ coc#pum#visible() ? coc#pum#prev(1) : | |
\ CheckBackspace() ? "\<Tab>" : | |
\ coc#refresh() | |
" Ctrl-P | |
nnoremap <C-p> :Files<CR> | |
" copy and paste | |
vmap <C-x> "+c | |
vmap <C-c> "+y | |
vmap <C-v> c<ESC>"+p | |
imap <C-v> <ESC>"+pa | |
let g:ale_fixers = {'javascript': ['prettier', 'eslint']} | |
let g:ale_linters = {'javascript': ['prettier', 'eslint']} | |
let g:ale_lint_on_save = 1 | |
let g:ale_fix_on_save = 1 | |
set tabstop=2 | |
set softtabstop=2 | |
set shiftwidth=2 | |
set expandtab | |
set nu | |
set hidden | |
set listchars=eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣ | |
" Initialize plugin system |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment