diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index c7c69b4..d304b92 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -92,6 +92,7 @@ autocmd Filetype nim setlocal ts=2 sts=2 sw=2 expandtab autocmd Filetype less setlocal ts=2 sts=2 sw=2 expandtab autocmd Filetype css setlocal ts=2 sts=2 sw=2 expandtab let g:syntastic_javascript_checkers = ['eslint', 'flow'] +let g:syntastic_java_checkers = [] let g:neoformat_javascript_prettier = { \ 'exe': 'prettier', @@ -181,10 +182,11 @@ fun! JumpToDef() endf " Jump to tag -nn :call JumpToDef() -ino :call JumpToDef()i +" nn :call JumpToDef() +" ino :call JumpToDef()i "nn :Rg +nnoremap ff :Rg autocmd FileType ocaml nmap :MerlinTypeOf @@ -276,17 +278,37 @@ Plug 'kana/vim-textobj-user' Plug 'kana/vim-textobj-line' Plug 'Julian/vim-textobj-brace' Plug 'bps/vim-textobj-python' +Plug 'wellle/targets.vim' Plug 'svermeulen/vim-easyclip' Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } +Plug 'junegunn/fzf.vim' Plug 'jremmen/vim-ripgrep' Plug 'rescript-lang/vim-rescript' Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'kassio/neoterm' Plug 'reasonml-editor/vim-reason-plus' Plug 'jyapayne/vim-code-dark' +Plug 'puremourning/vimspector' +Plug 'nvim-lua/popup.nvim' +Plug 'nvim-lua/plenary.nvim' +Plug 'nvim-telescope/telescope.nvim' +Plug 'kyazdani42/nvim-web-devicons' +Plug 'ryanoasis/vim-devicons' +Plug 'TimUntersberger/neogit' +Plug 'sindrets/diffview.nvim' +Plug 'lewis6991/gitsigns.nvim' + "Plug 'baabelfish/nvim-nim' call plug#end() +" lewis6991/gitsigns.nvim +lua << EOF + require('gitsigns').setup({ + \ word_diff = true + \ }) +EOF + + let $NVIM_TUI_ENABLE_TRUE_COLOR=1 set termguicolors @@ -587,7 +609,7 @@ nmap gy (coc-type-definition) nmap gi (coc-implementation) nmap gr (coc-references) -" Use K to show documentation in preview window. +" Use J to show documentation in preview window. nnoremap J :call show_documentation() function! s:show_documentation() @@ -640,14 +662,12 @@ xmap ac (coc-classobj-a) omap ac (coc-classobj-a) " Remap and for scroll float windows/popups. -if has('nvim-0.4.0') || has('patch-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)\" : "\" - vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" - vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" -endif +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)\" : "\" +vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" +vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" " Use CTRL-S for selections ranges. " Requires 'textDocument/selectionRange' support of language server. @@ -758,4 +778,62 @@ for tool in s:opam_packages call s:opam_configuration[tool]() endif endfor + " ## end of OPAM user-setup addition for vim / base ## keep this line +let g:ale_linters = {'java': []} + +" for normal mode - the word under the cursor +nmap di VimspectorBalloonEval +" for visual mode, the visually selected text +xmap di VimspectorBalloonEval +let g:vimspector_enable_mappings = 'HUMAN' + +" nnoremap :GFiles + +" nvim-telescope/telescope.nvim +lua << EOF +_G.telescope_find_files_in_path = function(path) + local _path = path or vim.fn.input("Dir: ", "", "dir") + require("telescope.builtin").find_files({search_dirs = {_path}}) +end +EOF +lua << EOF +_G.telescope_live_grep_in_path = function(path) + local _path = path or vim.fn.input("Dir: ", "", "dir") + require("telescope.builtin").live_grep({search_dirs = {_path}}) +end +EOF + +nnoremap :Telescope git_files +nnoremap fd :lua telescope_find_files_in_path() +nnoremap fD :lua telescope_live_grep_in_path() +nnoremap ft :lua telescope_find_files_in_path("./tests") +nnoremap fT :lua telescope_live_grep_in_path("./tests") +" nnoremap ff :Telescope live_grep +nnoremap fo :Telescope file_browser +nnoremap fn :Telescope find_files +nnoremap fg :Telescope git_branches +nnoremap fb :Telescope buffers +nnoremap fs :Telescope lsp_document_symbols +nnoremap ff :Telescope live_grep +nnoremap FF :Telescope grep_string + +" TimUntersberger/neogit and sindrets/diffview.nvim +lua << EOF +require("neogit").setup { + disable_commit_confirmation = true, + integrations = { + diffview = true + } + } +EOF +nnoremap gg :Neogit +nnoremap gd :DiffviewOpen +nnoremap gD :DiffviewOpen main +nnoremap gl :Neogit log +nnoremap gp :Neogit push + + +hi GitSignsAdd ctermfg=green ctermbg=none guibg=#212121 guifg=#32cd32 gui=bold cterm=bold +hi GitSignsDelete ctermfg=red ctermbg=none guibg=#212121 guifg=#ff6347 gui=bold cterm=bold +hi GitSignsChange ctermfg=blue ctermbg=none guibg=#212121 guifg=#1e90ff gui=bold cterm=bold