inoremap jj set colorcolumn=88,100,120 set number set clipboard+=unnamedplus set shiftwidth=2 set mouse=a map map autocmd WinEnter * if &buftype ==# 'terminal' | startinsert | endif noremap w inoremap w tnoremap w tnoremap filetype plugin indent on syntax enable " plugins call plug#begin('~/.vim/plugged') "Plug 'itchyny/lightline.vim' Plug 'glepnir/galaxyline.nvim' , {'branch': 'main'} Plug 'kyazdani42/nvim-web-devicons' Plug 'sainnhe/sonokai' Plug 'prabirshrestha/async.vim' Plug 'neoclide/coc.nvim', { 'merged': 0, 'branch': 'release' } Plug 'tjdevries/coc-zsh' Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'kien/rainbow_parentheses.vim' Plug 'Yggdroot/indentLine' Plug 'rhysd/committia.vim' Plug 'airblade/vim-gitgutter' Plug 'psf/black', { 'branch': 'stable' } " Plug 'yuki-ycino/fzf-preview.vim', { 'branch': 'release', 'do': ':UpdateRemotePlugins' } Plug 'nvim-lua/popup.nvim' Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim' Plug 'lambdalisue/fern.vim' call plug#end() "Black autocmd BufWritePre *.py execute ':Black' let g:black_linelength=100 set noshowmode lua require('plugins.galaxyline') " let g:lightline = { " \ 'colorscheme': 'sonokai', " \ 'active': { " \ 'left': [[ 'mode', 'paste' ], [ 'gitbranch', 'readonly', 'filename', 'modified' ]], " \ 'right': [[ 'lineinfo' ], [ 'fileencoding', 'filetype', ]], " \ }, " \ 'component': {'charvaluehex': '0x%B'}, " \ 'component_function': {'gitbranch': 'FugitiveHead'}, " \ } " Colorscheme " important!! set termguicolors " the configuration options should be placed before `colorscheme sonokai` let g:sonokai_style = 'andromeda' let g:sonokai_enable_italic = 1 let g:sonokai_enable_italic = 1 colorscheme sonokai " tab setting set showtabline=1 nnoremap [TABCMD] nmap t [TABCMD] nnoremap [TABCMD]f :tabfirst nnoremap [TABCMD]l :tablast nnoremap [TABCMD]n :tabnext nnoremap [TABCMD]N :tabNext nnoremap [TABCMD]p :tabprevious nnoremap [TABCMD]e :tabedit nnoremap [TABCMD]w :tabclose nnoremap [TABCMD]o :tabonly nnoremap [TABCMD]c :tabs nnoremap [TABCMD]s :tabnew nnoremap [TABCMD]v :tabvew " Coc Settings " Make auto-select the first completion item and notify coc.nvim to " format on enter, could be remapped by other vim plugin inoremap pumvisible() ? coc#_select_confirm() \: "\u\\=coc#on_enter()\" " Use `[g` and `]g` to navigate diagnostics " Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. nmap [g (coc-diagnostic-prev) nmap ]g (coc-diagnostic-next) " GoTo code navigation. nmap gd (coc-definition) nmap gy (coc-type-definition) nmap gi (coc-implementation) nmap gr (coc-references) " Use K to show documentation in preview window. nnoremap K :call show_documentation() function! s:show_documentation() if (index(['vim','help'], &filetype) >= 0) execute 'h '.expand('') elseif (coc#rpc#ready()) call CocActionAsync('doHover') else execute '!' . &keywordprg . " " . expand('') endif endfunction " Highlight the symbol and its references when holding the cursor. autocmd CursorHold * silent call CocActionAsync('highlight') " Symbol renaming. nmap rn (coc-rename) " Formatting selected code. xmap fo (coc-format-selected) nmap fo (coc-format-selected) augroup mygroup autocmd! " Setup formatexpr specified filetype(s). autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') " Update signature help on jump placeholder. autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') augroup end " Applying codeAction to the selected region. " Example: `aap` for current paragraph xmap a (coc-codeaction-selected) nmap a (coc-codeaction-selected) " Remap keys for applying codeAction to the current buffer. nmap ac (coc-codeaction) " Apply AutoFix to problem on the current line. nmap qf (coc-fix-current) " Map function and class text objects " NOTE: Requires 'textDocument.documentSymbol' support from the language server. xmap if (coc-funcobj-i) omap if (coc-funcobj-i) xmap af (coc-funcobj-a) omap af (coc-funcobj-a) xmap ic (coc-classobj-i) omap ic (coc-classobj-i) xmap ac (coc-classobj-a) omap ac (coc-classobj-a) " Remap and for scroll float windows/popups. " Note coc#float#scroll works on neovim >= 0.4.0 or vim >= 8.2.0750 nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" " NeoVim-only mapping for visual mode scroll " Useful on signatureHelp after jump placeholder of snippet expansion if has('nvim') vnoremap coc#float#has_scroll() ? coc#float#nvim_scroll(1, 1) : "\" vnoremap coc#float#has_scroll() ? coc#float#nvim_scroll(0, 1) : "\" endif " Use CTRL-S for selections ranges. " Requires 'textDocument/selectionRange' support of language server. nmap (coc-range-select) xmap (coc-range-select) " Add `:Format` command to format current buffer. command! -nargs=0 Format :call CocAction('format') " Add `:Fold` command to fold current buffer. command! -nargs=? Fold :call CocAction('fold', ) " Add `:OR` command for organize imports of the current buffer. command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') " Add (Neo)Vim's native statusline support. " NOTE: Please see `:h coc-status` for integrations with external plugins that " provide custom statusline: lightline.vim, vim-airline. set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} " Mappings for CoCList " Show all diagnostics. nnoremap a :CocList diagnostics " Manage extensions. nnoremap e :CocList extensions " Show commands. nnoremap c :CocList commands " Find symbol of current document. nnoremap o :CocList outline " Search workspace symbols. nnoremap s :CocList -I symbols " Do default action for next item. nnoremap j :CocNext " Do default action for previous item. nnoremap k :CocPrev " Resume latest coc list. nnoremap p :CocListResume if has('nvim') " telescope.nvim nnoremap ff lua require('telescope.builtin').find_files() nnoremap fg lua require('telescope.builtin').live_grep() nnoremap fb lua require('telescope.builtin').buffers() nnoremap fh lua require('telescope.builtin').help_tags() lua require('plugins') endif " committia let g:committia_hooks = {} function! g:committia_hooks.edit_open(info) " Additional settings setlocal spell " If no commit message, start with insert mode if a:info.vcs ==# 'git' && getline(1) ==# '' startinsert endif " Scroll the diff window from insert mode " Map and imap (committia-scroll-diff-down-half) imap (committia-scroll-diff-up-half) endfunction highlight Normal ctermbg=NONE guibg=NONE highlight NonText ctermbg=NONE guibg=NONE highlight LineNr ctermbg=NONE guibg=NONE highlight SpecialKey ctermbg=NONE guibg=NONE highlight EndOfBuffer ctermbg=NONE guibg=NONE autocmd Filetype json setl conceallevel=0 " It doesn't works "let g:indentLine_enabled = 0