diff --git a/config/.config/nvim/lazy-lock.json b/config/.config/nvim/lazy-lock.json index 94df304..7b239a8 100644 --- a/config/.config/nvim/lazy-lock.json +++ b/config/.config/nvim/lazy-lock.json @@ -1,37 +1,34 @@ { - "LuaSnip": { "branch": "master", "commit": "c7984d1cca3d8615e4daefc196597872a0b8d590" }, + "LuaSnip": { "branch": "master", "commit": "105b5f7f72c13e682a3aa5d29eac2408ae513b22" }, "aerial.nvim": { "branch": "master", "commit": "fb1f08c9f90e8b0c04b2f2c5d95d06288a14c5b2" }, - "ai.nvim": { "branch": "main", "commit": "d7391d4782b90ad3501f6f716f2b308092981787" }, "asyncrun.vim": { "branch": "master", "commit": "7191d0c30dd105e5d7f897b9a6ee19cabe734466" }, - "auto-session": { "branch": "main", "commit": "7afbb149f87be279778689596c781882014f7eef" }, + "auto-session": { "branch": "main", "commit": "21033c6815f249a7839c3a85fc8a6b44d74925c9" }, "calendar-vim": { "branch": "master", "commit": "a7e73e02c92566bf427b2a1d6a61a8f23542cc21" }, "catppuccin": { "branch": "main", "commit": "3ffd2f511f3dc6c01258923d7170ccaf1445634b" }, - "ciderlsp-nvim": { "branch": "main", "commit": "45ee3634c6d4224c6981825da5bde39804addc71" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-calc": { "branch": "main", "commit": "50792f34a628ea6eb31d2c90e8df174671e4e7a0" }, "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, - "cmp-nvim-ciderlsp": { "branch": "main", "commit": "e1b0015a0c090e20d1cbb34e5639e6dd145d3f3e" }, "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, "cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f0f53f704c08ea501f9d222b23491b0d354644b0" }, "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" }, "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-spell": { "branch": "master", "commit": "60584cb75e5e8bba5a0c9e4c3ab0791e0698bffa" }, + "cmp-tabnine": { "branch": "main", "commit": "b93f82ef5150e578677fc2e2b4b328b19eed77e1" }, "cmp-treesitter": { "branch": "master", "commit": "389eadd48c27aa6dc0e6b992644704f026802a2e" }, "cmp-under-comparator": { "branch": "master", "commit": "6857f10272c3cfe930cece2afa2406e1385bfef8" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "conflict-marker.vim": { "branch": "master", "commit": "11a4d42244755505b66b15cd4496a150432eb5e3" }, "crates.nvim": { "branch": "main", "commit": "1dffccc0a95f656ebe00cacb4de282473430c5a1" }, "formatter.nvim": { "branch": "master", "commit": "fa4f2729cc2909db599169f22d8e55632d4c8d59" }, - "friendly-snippets": { "branch": "main", "commit": "ca668b7a4a2913ad1109b5e4aaf0013651956b13" }, + "friendly-snippets": { "branch": "main", "commit": "6153166d5a3dcc7e2809ea4f17f9edb34d026026" }, "fzf": { "branch": "master", "commit": "547e101f1d6bf326d286bac0fb3272738a92a67f" }, "fzf.vim": { "branch": "master", "commit": "1dcdb21db618055134cd611f4f5918f6d00a5df0" }, "git-conflict.nvim": { "branch": "main", "commit": "8d962d83cae924a314965f738ed1e05a4000d682" }, "gitsigns.nvim": { "branch": "main", "commit": "48c3ae8ec74cb83f9570ceb0c5ab8217db7a2220" }, "go.nvim": { "branch": "master", "commit": "6550ddf5ce491d17af009c397aceb25310566eaa" }, "guihua.lua": { "branch": "master", "commit": "ab8b1f09603cc268770efd057115035dc6cfa83d" }, - "hg": { "branch": "main", "commit": "1c4bdf80174ec840ba76c4dc7032c4313db62199" }, "java-syntax.vim": { "branch": "master", "commit": "9a3d76a8c6cd7765ba93a7bdd9280594167e3f1b" }, "kotlin-vim": { "branch": "master", "commit": "53fe045906df8eeb07cb77b078fc93acda6c90b8" }, "lazy.nvim": { "branch": "main", "commit": "14d76aac4bd3ff07c1fca074c210f28f766a931e" }, @@ -42,7 +39,6 @@ "lsp_lines.nvim": { "branch": "main", "commit": "f53af96d4789eef39a082dbcce078d2bfc384ece" }, "lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, - "luasnip-google.nvim": { "branch": "main", "commit": "5fd7feb144de0ecea837618c9c9e1bbecc0e3243" }, "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "796008869e67ef27a5aa5ac44c08ce2a60b89f55" }, "mason.nvim": { "branch": "main", "commit": "5ad3e113b0c3fde3caba8630599373046f6197e8" }, @@ -52,14 +48,13 @@ "nui.nvim": { "branch": "main", "commit": "d146966a423e60699b084eeb28489fe3b6427599" }, "null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" }, "nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" }, - "nvim-lightbulb": { "branch": "master", "commit": "bb9ec720aa998252951627f811e8f39b76789e0a" }, - "nvim-lspconfig": { "branch": "master", "commit": "deade69789089c3da15237697156334fb3e943f0" }, + "nvim-lightbulb": { "branch": "master", "commit": "6166029a136afd56cf23384fc31e8ba203a6e102" }, + "nvim-lspconfig": { "branch": "master", "commit": "f88fc62d9770e70faab132ddfed680e49fb012f3" }, "nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" }, "nvim-osc52": { "branch": "main", "commit": "3e96035d62290183fe7a11418db2b254fcfcaee3" }, "nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" }, "nvim-treesitter": { "branch": "master", "commit": "575f5a4b1fcb60c1ac4f560c46a5171454d674ca" }, "nvim-web-devicons": { "branch": "master", "commit": "9ab9b0b894b2388a9dbcdee5f00ce72e25d85bf9" }, - "nvim_figtree": { "branch": "main", "commit": "9bc3025f46e34732382da1019e256a9d8bec1e55" }, "plenary.nvim": { "branch": "master", "commit": "bda256fab0eb66a15e8190937e417e6a14ee5d72" }, "refactoring.nvim": { "branch": "master", "commit": "56b747d1be0aa5cecddf85e6f3ca2aed6797edef" }, "registers.nvim": { "branch": "main", "commit": "2ab8372bb837f05fae6b43091f10a0b725d113ca" }, @@ -67,16 +62,14 @@ "telekasten.nvim": { "branch": "main", "commit": "4a5e57eee9c5154ed77423bb7fa6619fdb0784cd" }, "telescope-file-browser.nvim": { "branch": "master", "commit": "e03ff55962417b69c85ef41424079bb0580546ba" }, "telescope.nvim": { "branch": "master", "commit": "276362a8020c6e94c7a76d49aa00d4923b0c02f3" }, - "telescope_citc": { "branch": "main", "commit": "d6421d5bfe058915ece0daec55e488f8ea05f207" }, - "telescope_codesearch": { "branch": "main", "commit": "a26077ad3c68cf897ae1c31da903d6516ebb9c92" }, - "telescope_fig": { "branch": "main", "commit": "90150e1aa368b49a5125689b3a6da573a99e2bda" }, "trouble.nvim": { "branch": "main", "commit": "d99e2abd10808ef91738ce98a5c767e6a51df449" }, "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }, "vcscommand.vim": { "branch": "master", "commit": "2fb32681361f37533455d20aaa7fc6eb11b0fa4b" }, + "vim-bazel": { "branch": "master", "commit": "31b0d5e4f51da1aeb56d65bf505a744e6de405de" }, "vim-better-whitespace": { "branch": "master", "commit": "1b22dc57a2751c7afbc6025a7da39b7c22db635d" }, "vim-dirdiff": { "branch": "master", "commit": "84bc8999fde4b3c2d8b228b560278ab30c7ea4c9" }, - "vim-imp": { "branch": "main", "commit": "394e926ce62010443731f3923031e5afa1279f3e" }, "vim-indent-guides": { "branch": "master", "commit": "a1e1390c0136e63e813d051de2003bf0ee18ae30" }, + "vim-maktaba": { "branch": "master", "commit": "fe95bb10f6bb250943a44632107f6a3d76ce5f28" }, "vim-matchup": { "branch": "master", "commit": "17cc05867cb3314761e4baa20115a27120f8e82c" }, "vim-ripgrep": { "branch": "master", "commit": "2bb2425387b449a0cd65a54ceb85e123d7a320b8" }, "vim-searchindex": { "branch": "master", "commit": "b0788c8213210b3bd23b62847dd5a9ebbe4ad648" }, diff --git a/vim/.vim/lua/plugins/bazel.lua b/vim/.vim/lua/plugins/bazel.lua new file mode 100644 index 0000000..f5ad840 --- /dev/null +++ b/vim/.vim/lua/plugins/bazel.lua @@ -0,0 +1,8 @@ +return { + { + "bazelbuild/vim-bazel", + dependencies = { + "google/vim-maktaba", + }, + }, +} diff --git a/vim/.vim/lua/plugins/formatter.lua b/vim/.vim/lua/plugins/formatter.lua index 5c57c98..01efef3 100644 --- a/vim/.vim/lua/plugins/formatter.lua +++ b/vim/.vim/lua/plugins/formatter.lua @@ -12,63 +12,26 @@ return { log_level = vim.log.levels.WARN, -- All formatter configurations are opt-in filetype = { - -- Formatter configurations for filetype "lua" go here - -- and will be executed in order - lua = { - -- "formatter.filetypes.lua" defines default configurations for the - -- "lua" filetype - -- require("formatter.filetypes.lua").stylua, - -- You can also define your own configuration - function() - -- Supports conditional formatting - if util.get_current_buffer_file_name() == "special.lua" then - return nil - end - - -- Full specification of configurations is down below and in Vim help - -- files - return { - exe = "stylua", - args = { - "--search-parent-directories", - "--stdin-filepath", - util.escape_path(util.get_current_buffer_file_path()), - "--", - "-", - }, - stdin = true, - } - end, - }, - - html = { - require("formatter.defaults").prettier, - }, - xml = { - function() - return { - exe = "tidy", - args = { - "-quiet", - "-xml", - "--indent auto", - "--indent-spaces 2", - "--verical-space yes", - "--tidy-mark no", - }, - stdin = true, - try_node_modules = true, - } - end, - }, - + -- xml = { + -- function() + -- return { + -- exe = "tidy", + -- args = { + -- "-quiet", + -- "-xml", + -- "--indent auto", + -- "--indent-spaces 2", + -- "--verical-space yes", + -- "--tidy-mark no", + -- }, + -- stdin = true, + -- try_node_modules = true, + -- } + -- end, + -- }, + -- -- Use the special "*" filetype for defining formatter configurations on -- any filetype - ["*"] = { - -- "formatter.filetypes.any" defines default configurations for any - -- filetype - require("formatter.filetypes.any").remove_trailing_whitespace, - }, }, }) vim.cmd([[ diff --git a/vim/.vim/lua/plugins/go.lua b/vim/.vim/lua/plugins/go.lua new file mode 100644 index 0000000..ff20f75 --- /dev/null +++ b/vim/.vim/lua/plugins/go.lua @@ -0,0 +1,24 @@ +return { + { + "ray-x/go.nvim", + dependencies = { -- optional packages + "ray-x/guihua.lua", + "neovim/nvim-lspconfig", + "nvim-treesitter/nvim-treesitter", + }, + config = function() + require("go").setup() + local format_sync_grp = vim.api.nvim_create_augroup("GoFormat", {}) + vim.api.nvim_create_autocmd("BufWritePre", { + pattern = "*.go", + callback = function() + require("go.format").goimport() + end, + group = format_sync_grp, + }) + end, + event = { "CmdlineEnter" }, + ft = { "go", "gomod" }, + build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries + }, +} diff --git a/vim/.vim/lua/plugins/null-ls.lua b/vim/.vim/lua/plugins/null-ls.lua index 4f81bb2..097ad4b 100644 --- a/vim/.vim/lua/plugins/null-ls.lua +++ b/vim/.vim/lua/plugins/null-ls.lua @@ -7,6 +7,8 @@ return { local TableConcat = require("utils").TableConcat local sources = { + -- * + null_ls.builtins.formatting.trim_whitespace, -- Catch insensitive, inconsiderate writing. null_ls.builtins.diagnostics.alex, @@ -22,6 +24,12 @@ return { -- Reformats Java source code according to Google Java Style. null_ls.builtins.formatting.google_java_format, + + -- XML + null_ls.builtins.diagnostics.tidy, + -- null_ls.builtins.formatting.xmlformat + + null_ls.builtins.formatting.stylua, } if not use_google then diff --git a/vim/.vim/prefs/coc.vim b/vim/.vim/prefs/coc.vim deleted file mode 100644 index 7e4bb90..0000000 --- a/vim/.vim/prefs/coc.vim +++ /dev/null @@ -1,172 +0,0 @@ -Plug 'neoclide/coc.nvim', {'branch': 'release'} -Plug 'IngoMeyer441/coc_current_word' -" Set internal encoding of vim, not needed on neovim, since coc.nvim using some -" unicode characters in the file autoload/float.vim -set encoding=utf-8 - -" TextEdit might fail if hidden is not set. -set hidden - -" Some servers have issues with backup files, see #649. -set nobackup -set nowritebackup - -" Give more space for displaying messages. -set cmdheight=2 - -" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable -" delays and poor user experience. -set updatetime=300 - -" Don't pass messages to |ins-completion-menu|. -set shortmess+=c - -" Formatting selected code. -" xmap f (coc-format-selected) -" nmap f (coc-format-selected) -nmap rn (coc-rename) -" pc = pick color -nmap pc :call CocAction('pickColor') - -" yaml outline -nmap yo -nmap pm :CocCommand markdown-preview-enhanced.openPreview - -nmap cr :CocRestart -" let g:node_client_debug = 1 -let g:coc_global_extensions = [ 'coc-emoji', 'coc-eslint', 'coc-tsserver', 'coc-tslint', 'coc-tslint-plugin', 'coc-css', 'coc-json', 'coc-pyls', 'coc-yaml', 'coc-html', 'coc-go', 'coc-git', 'coc-css', 'coc-sql', 'coc-sh', 'coc-rust-analyzer', 'coc-java', 'coc-kotlin', 'coc-explorer', 'coc-highlight', 'coc-marketplace', 'coc-zi', 'coc-syntax', 'coc-fzf-preview', 'coc-mocword'] - -" Don't pass messages to |ins-completion-menu|. -set shortmess+=c - -" Always show the signcolumn, otherwise it would shift the text each time -" diagnostics appear/become resolved. -if has("nvim-0.5.0") || has("patch-8.1.1564") - " Recently vim can merge signcolumn and number column into one - set signcolumn=number -else - set signcolumn=yes -endif - -" Use tab for trigger completion with characters ahead and navigate. -" NOTE: Use command ':verbose imap ' to make sure tab is not mapped by -" other plugin before putting this into your config. -inoremap - \ pumvisible() ? "\" : - \ check_back_space() ? "\" : - \ coc#refresh() -inoremap pumvisible() ? "\" : "\" - -function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' -endfunction - -" Use to trigger completion. -if has('nvim') - inoremap coc#refresh() -else - inoremap coc#refresh() -endif - -" 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()\" - -" Applying codeAction to the selected region. -" Example: `aap` for current paragraph -xmap a (coc-codeaction-selected) -nmap a (coc-codeaction-selected) -vmap a (coc-codeaction-selected) - -" Remap keys for applying codeAction to the current buffer. -nmap ca (coc-codeaction) -" Apply AutoFix to problem on the current line. -nmap qf (coc-fix-current) - -" Run the Code Lens action on the current line. -nmap cl (coc-codelens-action) - -"" Remap for do codeAction of selected region -function! s:cocActionsOpenFromSelected(type) abort - execute 'CocCommand actions.open ' . a:type -endfunction - - -" Use `[g` and `]g` to navigate diagnostics -nmap [g (coc-diagnostic-prev) -nmap ]g (coc-diagnostic-next) - -" Remap keys for gotos -nmap gd (coc-definition) -nmap gy (coc-type-definition) -nmap gi (coc-implementation) -nmap gr (coc-references) - -" 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) - -" We're going to define single-letter keymaps, so don't try to define them -" in the terminal window. The debugger CLI should continue accepting text commands. -function! NvimGdbNoTKeymaps() - tnoremap -endfunction - -let g:nvimgdb_config_override = { - \ 'key_next': 'n', - \ 'key_step': 's', - \ 'key_finish': 'f', - \ 'key_continue': 'c', - \ 'key_until': 'u', - \ 'key_breakpoint': 'b', - \ 'set_tkeymaps': "NvimGdbNoTKeymaps", - \ } - -" Use K to show documentation in preview window. -nnoremap L :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 - -set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')} - -" Apply AutoFix to problem on the current line. -nmap qf (coc-fix-current) -nmap zg :CocCommand cSpell.addWordToDictionary - -" 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 diff --git a/vim/.vim/prefs/ctrlp.vim b/vim/.vim/prefs/ctrlp.vim deleted file mode 100644 index 14b5ce5..0000000 --- a/vim/.vim/prefs/ctrlp.vim +++ /dev/null @@ -1,42 +0,0 @@ -" -------- CTRL-P -------- -let g:ctrlp_map = '' -let g:ctrlp_show_hidden = 1 -let g:ctrlp_working_path_mode = 'ra' -set wildignore+=*/tmp/*,*.so,*.swo,*.swp,*.zip,*.o,*.d " MacOSX/Linux -"let g:ctrlp_custom_ignore = '\v[\/](vendor|node_modules|target|dist|build)|(\.(swp|ico|git|svn))$' -let g:ctrlp_custom_ignore = { - \ 'dir': 'vendor\|node_modules\|target\|dist\|build\|mntdeps', - \'file': '\v\.(swp|ico|git|svn|exe)' -\ } -"let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard'] -let g:ctrlp_extensions = ['smarttabs'] -let g:ctrlp_switch_buffer = 'ETVH' -let g:ctrlp_open_new_file = 't' - -" Let CtrlP not go all the way up to the root of the client. Instead, consider a -" METADATA file to delimit a project. -let g:ctrlp_root_markers = ['METADATA'] - -" CtrlP auto cache clearing. -function! SetupCtrlP() - if exists("g:loaded_ctrlp") && g:loaded_ctrlp - augroup CtrlPExtension - autocmd! - autocmd FocusGained * CtrlPClearCache - autocmd BufWritePost * CtrlPClearCache - augroup END - endif -endfunction -if has("autocmd") - autocmd VimEnter * :call SetupCtrlP() -endif - -" Ripgrep (rg) is a super fast search utility -" Use rg for ctrl-p plugin -if executable('rg') - set grepprg=rg\ --hidden\ --color=never - let g:ctrlp_use_caching = 0 - let g:ctrlp_user_command = 'rg --files --hidden --color=never * %s' -endif - - diff --git a/vim/.vim/prefs/fzf.vim b/vim/.vim/prefs/fzf.vim deleted file mode 100644 index 9ad65c4..0000000 --- a/vim/.vim/prefs/fzf.vim +++ /dev/null @@ -1,30 +0,0 @@ -"nnoremap :FZF -m -"let $FZF_DEFAULT_COMMAND = 'ag -g ""' - -" nmap :FZF - -nmap (fzf-maps-n) -xmap (fzf-maps-x) -omap (fzf-maps-o) -let g:fzf_preview_window = ['right:50%', 'ctrl-/'] -let g:fzf_history_dir = '~/.local/share/fzf-history' -let g:fzf_command_prefix = 'Fzf' -" use the same keybindings for fzf as in shell -" nnoremap :FzfHgFiles -" nnoremap :FzfHgRg -let s:hg_command = 'hg pstatus -ma -n --template= -- 2>/dev/null' -let s:rg_command = 'rg --ignore-case --hidden --follow --color auto --line-number' - -command! -bang FzfHgFiles -\ call fzf#run(fzf#wrap({ -\ 'source': s:hg_command, -\ }), -\ 0 -\ ) -command! -bang -nargs=* ClSearch -\ call fzf#vim#grep( -\ s:rg_command . " " . . " " . "$(" . s:hg_command . ")", 1, -\ 0 ? fzf#vim#with_preview('up:60%') -\ : fzf#vim#with_preview('right:50%'), -\ 0) - diff --git a/vim/.vim/prefs/imp.vim b/vim/.vim/prefs/imp.vim deleted file mode 100644 index e69de29..0000000 diff --git a/vim/.vim/prefs/leader.vim b/vim/.vim/prefs/leader.vim index fc9d116..3243a63 100644 --- a/vim/.vim/prefs/leader.vim +++ b/vim/.vim/prefs/leader.vim @@ -18,20 +18,12 @@ vmap ` c`"` " unhilight search nnoremap :nohlsearch -" EZ Ack search -" nnoremap a :Ack! -" nnoremap A :Ack! - " --------- CLIPBOARD MAPPINGS --------- " Paste from OS clipboard map v i"+pa vmap v c"+p imap v "+pa -" Copy to OS clipboard -" vnoremap y "yy :call system('xclip', @y) -" map y "yy :call system('xclip', @y) - " --------- WINDOW/PANE MAPPINGS --------- map wr r map H :wincmd H @@ -48,31 +40,11 @@ nnoremap s- :exe "vertical resize " . (winwidth(0) * 4/5) nnoremap x+ :exe "resize " . (winheight(0) * 3/2) nnoremap x- :exe "resize " . (winheight(0) * 2/3) - " --------- FORMATTING MAPPINGS --------- " indent file map = gg=G `` -" format HTML/JSON -map fh :%s/>\s*\r -map fj :%!python -m json.tool - -map fjs :call UnMinify() -"command! UnMinify call UnMinify() -function! UnMinify() - %s/{\ze[^\r\n]/{\r/g - %s/){/) {/g - %s/};\?\ze[^\r\n]/\0\r/g - %s/;\ze[^\r\n]/;\r/g - %s/[^\s]\zs[=&|]\+\ze[^\s]/ \0 /g - normal ggVG= -endfunction - - -nmap toi :CocCommand tsserver.organizeImports - nmap yf :let @+ = expand("%") -nmap ut :UndotreeToggle nmap e :e %% " replace currently selected text with default register @@ -81,16 +53,6 @@ vnoremap p "_dP nnoremap rp :VimuxOpenRunner :VimuxRunCommand '!!' :call VimuxSendKeys("Enter") -"Showing highlight groups -" nmap sp :call SynStack() -nmap shg :call SynStack() -function! SynStack() - if !exists("*synstack") - return - endif - echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') -endfunc - nnoremap s :SessionSave " copy to attached terminal using the yank(1) script: diff --git a/vim/.vim/prefs/ycm.vim b/vim/.vim/prefs/ycm.vim deleted file mode 100644 index 347ae8c..0000000 --- a/vim/.vim/prefs/ycm.vim +++ /dev/null @@ -1,36 +0,0 @@ -Glug youcompleteme-google - -let g:ycm_key_invoke_completion = '' -let g:ycm_filetype_specific_completion_to_disable = {'cpp': 1, 'c': 1} - -let g:ycm_language_server = - \ [ - \ { - \ 'name': 'ciderlsp', - \ 'cmdline': [ '/google/bin/releases/cider/ciderlsp/ciderlsp', '--noforward_sync_responses' ], - \ 'filetypes': [ 'java' ] - \ }, - \ ] - -nmap gd :YcmCompleter GoToDeclaration -nmap gt :YcmCompleter GetType -nmap gr :YcmCompleter GoToReferences -nmap qf :YcmCompleter FixIt -nmap rn :YcmCompleter RefactorRename - -let s:ycm_hover_popup = -1 -function s:Hover() - let response = youcompleteme#GetCommandResponse( 'GetDoc' ) - if response == '' - return - endif - - call popup_hide( s:ycm_hover_popup ) - let s:ycm_hover_popup = popup_atcursor( balloon_split( response ), {} ) -endfunction - -" CursorHold triggers in normal mode after a delay -autocmd CursorHold * call s:Hover() -" Or, if you prefer, a mapping: -" nnoremap D :call Hover() -nnoremap D (YCMHover)