if exists('g:vscode') " VSCode extension. " This is all the config for VSCode-Neovim. " normal Nvim uses ~/.vimrc. set backspace=2 set showmatch set ruler set mouse=a set ts=4 set sw=4 set cindent set cinoptions=:0,l1,g0 set nohlsearch set ignorecase set smartcase set autochdir set timeout timeoutlen=1000 ttimeoutlen=15 set title set guicursor=a:blinkon0-Cursor let g:netrw_mousemaps=0 set nu set signcolumn=no set updatetime=1000 """""""""" Plugins """""""""" set nocp filetype plugin on call plug#begin('~/.local/share/plugged') let g:plug_url_format='git@github.com:%s.git' Plug 'tpope/vim-repeat' Plug 'tpope/vim-surround' Plug 'elkowar/yuck.vim' Plug 'skywind3000/asyncrun.vim' call plug#end() """""""""" Remaps """""""""" command W w map Q ZZ func Semicolon() let line = getline('.') if match(line, "for") == -1 && match(line, "if") == -1 return "\;" else return ';' endif endfunc au BufNewFile,BufRead *.frag,*.vert,*.geom,*.fp,*.vp,*.glsl setf glsl augroup vimrc_cmaps autocmd FileType c,cpp,rust,typescript inoremap ; Semicolon() autocmd FileType vim,c,cpp,go,rust,python,typescript,tex inoremap ( () autocmd FileType vim,c,cpp,go,rust,python,typescript,tex inoremap [ [] autocmd FileType vim,c,cpp,go,rust,python,typescript inoremap " "" autocmd FileType vim,c,cpp,go,rust,python,typescript inoremap ' '' autocmd FileType c,cpp,go,rust,typescript inoremap { {} autocmd FileType c,cpp,go,rust,typescript inoremap {} autocmd FileType vim,tex,python inoremap { {} autocmd FileType vim,tex,python inoremap {} augroup END " Guess what? Despite Neovim being smart enough to distinguish " from , it treats as anyways if " you have a normal mode mapping for . Screw me I guess. " Edit: My bad - Please refer to :h or :h CTRL-I. Maybe " learn to read sometime this century. " " https://vi.stackexchange.com/a/46704 " https://github.com/neovim/neovim/pull/17932 " " This magical line tricks Nvim into being smart again. nnoremap " Use Meta-HJKL for Left/Down/Up/Right. imap imap imap imap """""""""" AsyncRun """""""""" let g:asyncrun_open = 1 " Deactivate IME when leaving Insert mode. au InsertLeavePre * AsyncRun -silent which fcitx5-remote >/dev/null && fcitx5-remote -c """""""""" Misc """""""""" set tags+=~/.cache/ctags lang zh_CN.UTF-8 " Uncomment the following to have Vim jump to the last position when " reopening a file au BufReadPost * exe "normal! g'\"" set showmode else " ordinary Neovim set runtimepath^=~/.vim runtimepath+=~/.vim/after let &packpath = &runtimepath source ~/.vimrc endif