diff --git a/README.md b/README.md index 79e6633..48ae89e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,27 @@ # vim +My Vim configuration + +## vim-plug +#### Vim + +###### Unix +```sh +curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ + https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim +``` +#### Neovim +###### Linux +```sh +sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ + https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' +``` +## Conquer of Completion + +Run commands in NeoVim/Vim: +``` +:CocInstall coc-json coc-tsserver +:CocInstall coc-snippets +:CocInstall coc-vimtex +:CocInstall coc-pairs +``` diff --git a/init.vim b/init.vim old mode 100644 new mode 100755 index 6092f6a..ed8cfd9 --- a/init.vim +++ b/init.vim @@ -1,8 +1,8 @@ syntax on set number set cursorline -set expandtab smarttab tabstop=4 shiftwidth=4 softtabstop=4 -set autoindent smartindent +set expandtab tabstop=4 shiftwidth=4 softtabstop=4 +set autoindent " Fold @@ -30,33 +30,20 @@ Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'cocopon/iceberg.vim' Plug 'kevinhwang91/nvim-bqf' +Plug 'morhetz/gruvbox' call plug#end() "Color scheme -colorscheme iceberg +"colorscheme iceberg +colorscheme gruvbox set background=light +let g:gruvbox_contrast_light = 'hard' "Open NERDTree :nnoremap g:NERDTree.IsOpen() ? "\:NERDTreeClose" : bufexists(expand('%')) ? "\:NERDTreeFind" : "\:NERDTree" "Coc.nvim -:set completeopt=longest,menuone -:inoremap pumvisible() ? "\" : "\u\" -inoremap pumvisible() ? '' : - \ '=pumvisible() ? "\Down>" : ""' - -inoremap pumvisible() ? '' : - \ '=pumvisible() ? "\Down>" : ""' -" open omni completion menu closing previous if open and opening new menu without changing the text -inoremap (pumvisible() ? (col('.') > 1 ? 'i' : 'i') : '') . - \ '=pumvisible() ? "\C-n>\C-p>\Down>" : ""' -" open user completion menu closing previous if open and opening new menu without changing the text -inoremap (pumvisible() ? (col('.') > 1 ? 'i' : 'i') : '') . - \ '=pumvisible() ? "\C-n>\C-p>\Down>" : ""' - -"Autocomplete with the first option if pop up menu is open. -"inoremap pumvisible() ? coc#_select_confirm() : "\u\" inoremap pumvisible() ? coc#_select_confirm() : "\u\" inoremap \ pumvisible() ? coc#_select_confirm() : @@ -70,7 +57,7 @@ function! s:check_back_space() abort endfunction let g:coc_snippet_next = '' -nnoremap s :CocCommand snippets.editSnippets +nnoremap e :CocCommand snippets.editSnippets " Comments let mapleader = "," @@ -87,9 +74,23 @@ nnoremap h nnoremap j nnoremap k nnoremap l -nnoremap o :tabonly +nnoremap to :tabonly +nnoremap o :only +nnoremap :tabn +nnoremap :tabp +nnoremap + +"set clipboard+=unnamedplus +" " Copy to clipboard +vnoremap y "+y +nnoremap Y "+yg_ +nnoremap y "+y +nnoremap yy "+yy + +" " Paste from clipboard +nnoremap p "+p +nnoremap P "+P -set clipboard+=unnamedplus " FZF key mapping nnoremap b :Buffers @@ -102,17 +103,6 @@ filetype plugin on set splitright set splitbelow -" " Copy to clipboard -vnoremap y "+y -nnoremap Y "+yg_ -nnoremap y "+y -nnoremap yy "+yy - -" " Paste from clipboard -nnoremap p "+p -nnoremap P "+P -vnoremap p "+p -vnoremap P "+P function! IBusOff() " Lưu engine hiện tại @@ -154,7 +144,7 @@ silent call IBusOff() "Language tool let b:ale_linter_aliases = ['tex', 'text', 'html'] let g:ale_languagetool_executable = "java" -let g:ale_languagetool_options = "-jar /data/runtimes/languagetool/languagetool-commandline.jar --languagemodel /data/runtimes/languagemodel/ --word2vecmodel /data/runtimes/word2vec/ --disable WHITESPACE_RULE,COMMA_PARENTHESIS_WHITESPACE,CURRENCY[1]" +let g:ale_languagetool_options = "-jar /data/runtimes/languagetool/languagetool-commandline.jar --languagemodel /data/runtimes/languagemodel/ --word2vecmodel /data/runtimes/word2vec/ --disable WHITESPACE_RULE,COMMA_PARENTHESIS_WHITESPACE" let g:ale_disable_lsp = 1 map :ALEToggle