Dolphin type neovim.
looking nice
1 file changed, +28 -15
+28-15init.vim
| @@ -13,24 +13,28 @@ set shiftwidth=4 | ||
| 13 | 13 | set tabstop=4 |
| 14 | 14 | set encoding=utf8 |
| 15 | 15 | set history=5000 |
| 16 | +set autoread | |
| 16 | 17 | colorscheme habamax |
| 17 | 18 | highlight Normal ctermbg=none " Remove background color |
| 18 | 19 | :au FocusLost * :wa " Auto save when focus is lost |
| 19 | 20 | :au BufLeave * :wa " Auto save when buffer is left |
| 20 | -vnoremap p "0p " Keep last register after pasting in visual mode | |
| 21 | -nmap <leader>f gg=G <C-o> <C-o> | |
| 21 | +vnoremap p "0p | |
| 22 | +nmap <leader>f gg=G<C-o> | |
| 22 | 23 | nmap <leader>t :Telescope find_files<CR> |
| 23 | -set autoread | |
| 24 | -nmap gn :bnext<CR> | |
| 25 | -nmap gp :bprevious<CR> | |
| 26 | -nmap gq :bd<CR> :bn<CR> :NERDTreeFind<CR><CR> | |
| 24 | +nmap <leader>z :FZF<CR> | |
| 25 | +nmap <C-n> :bnext<CR> | |
| 26 | +nmap <C-p> :bprevious<CR> | |
| 27 | +nmap <C-k> :bd<CR> :bn<CR> :NERDTreeFind<CR><CR> | |
| 28 | +nmap <leader>w <C-w><C-w> | |
| 29 | +nmap <M-w> <C-w><C-w> | |
| 30 | +nmap <leader>ev :e $MYVIMRC<CR> | |
| 27 | 31 | |
| 28 | 32 | |
| 29 | 33 | " Vim-Plug settings |
| 30 | 34 | call plug#begin() |
| 31 | 35 | Plug 'preservim/nerdtree' | |
| 32 | 36 | \ Plug 'Xuyuanp/nerdtree-git-plugin' | |
| 33 | - \ Plug 'ryanoasis/vim-devicons' | |
| 37 | + \ Plug 'ryanoasis/vim-devicons' | |
| 34 | 38 | Plug 'neoclide/coc.nvim', {'branch': 'release'} |
| 35 | 39 | Plug 'github/copilot.vim' |
| 36 | 40 | Plug 'vim-airline/vim-airline-themes' |
| @@ -49,16 +53,16 @@ call plug#end() | ||
| 49 | 53 | |
| 50 | 54 | |
| 51 | 55 | " NERDTree settings |
| 52 | -nnoremap <leader>n :NERDTreeFocus<CR> | |
| 56 | +nnoremap <leader>n :NERDTreeFind<CR> | |
| 53 | 57 | autocmd VimEnter * NERDTree |
| 54 | 58 | |
| 55 | 59 | |
| 56 | 60 | " Code Completion |
| 57 | -nmap <silent> gd <Plug>(coc-definition) | |
| 58 | -nmap <silent> gy <Plug>(coc-type-definition) | |
| 59 | -nmap <silent> gr <Plug>(coc-references) | |
| 60 | -nmap <silent> [g <Plug>(coc-diagnostic-prev) | |
| 61 | -nmap <silent> ]g <Plug>(coc-diagnostic-next) | |
| 61 | +nmap <silent> gd <Plug>(coc-definition)zz | |
| 62 | +nmap <silent> gy <Plug>(coc-type-definition)zz | |
| 63 | +nmap <silent> gr <Plug>(coc-references)zz | |
| 64 | +nmap <silent> [g <Plug>(coc-diagnostic-prev)zz | |
| 65 | +nmap <silent> ]g <Plug>(coc-diagnostic-next)zz | |
| 62 | 66 | nnoremap <silent> <space>s :<C-u>CocList -I symbols<cr> |
| 63 | 67 | nnoremap <silent> <space>d :<C-u>CocList diagnostics<cr> |
| 64 | 68 | nmap <leader>do <Plug>(coc-codeaction) |
| @@ -69,7 +73,7 @@ let g:coc_global_extensions = [ | ||
| 69 | 73 | \ 'coc-css', |
| 70 | 74 | \ 'coc-eslint', |
| 71 | 75 | \ 'coc-prettier', |
| 72 | - \ 'coc-pyright' | |
| 76 | + \ 'coc-jedi' | |
| 73 | 77 | \ ] |
| 74 | 78 | " Make <CR> to accept selected completion item or notify coc.nvim to format |
| 75 | 79 | " <C-g>u breaks current undo, please make your own choice |
| @@ -94,4 +98,13 @@ lua require("toggleterm").setup({ | ||
| 94 | 98 | \ open_mapping = [[<c-\>]], |
| 95 | 99 | \ }) |
| 96 | 100 | |
| 97 | - | |
| 101 | +" Ensure the screen centers on jumping command | |
| 102 | +nmap <silent> <C-y> <C-y>zz | |
| 103 | +nmap <silent> <C-u> <C-u>zz | |
| 104 | +nmap <silent> <C-d> <C-d>zz | |
| 105 | +nmap <silent> <C-b> <C-b>zz | |
| 106 | +nmap <silent> <C-f> <C-f>zz | |
| 107 | +nmap <silent> <C-o> <C-o>zz | |
| 108 | +nmap <silent> <C-i> <C-i>zz | |
| 109 | +nmap <silent> <C-t> <C-t>zz | |
| 110 | +nmap <silent> <C-g> <C-g>zz |