Compare commits

...

2 Commits

Author SHA1 Message Date
ff24d719b1 clean and stuff 2023-07-12 21:32:04 -05:00
ab28a85172 telescope mapping 2023-07-12 20:47:35 -05:00
12 changed files with 67 additions and 388 deletions

View File

@ -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" },

View File

@ -0,0 +1,8 @@
return {
{
"bazelbuild/vim-bazel",
dependencies = {
"google/vim-maktaba",
},
},
}

View File

@ -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([[

View File

@ -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
},
}

View File

@ -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

View File

@ -3,6 +3,7 @@ local TableConcat = require("utils").TableConcat
local keys = {
{ "<leader>fb", ":Telescope file_browser path=%:p:h select_buffer=true<CR>", desc = "[F]ile [B]rowser" },
{ "<leader>tb", ":Telescope file_buffers<CR>", desc = "[T]elescope [B]uffers" },
{ "<leader>tg", ":Telescope git_files<CR>", desc = "[T]elescope [G]it Files" },
{ "<leader>th", [[:lua require('telescope.builtin').help_tags<cr>]], desc = "[T]elescope [H]elp" },
{ "<leader>t*", [[:lua require('telescope.builtin').grep_string<cr>]], desc = "[T]elescope current [W]ord" },
{ "<leader>tg", [[:lua require('telescope.builtin').live_grep<cr>]], desc = "[T]elescope by [G]rep" },

View File

@ -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 <leader>f <Plug>(coc-format-selected)
" nmap <leader>f <Plug>(coc-format-selected)
nmap <leader>rn <Plug>(coc-rename)
" pc = pick color
nmap <leader>pc :call CocAction('pickColor')<CR>
" yaml outline
nmap <leader>yo <C-S-O><cr>
nmap <leader>pm :CocCommand markdown-preview-enhanced.openPreview
nmap <leader>cr :CocRestart<CR>
" 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 <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use <c-space> to trigger completion.
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
" Make <CR> auto-select the first completion item and notify coc.nvim to
" format on enter, <cr> could be remapped by other vim plugin
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" Applying codeAction to the selected region.
" Example: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
vmap <leader>a <Plug>(coc-codeaction-selected)
" Remap keys for applying codeAction to the current buffer.
nmap <leader>ca <Plug>(coc-codeaction)
" Apply AutoFix to problem on the current line.
nmap <leader>qf <Plug>(coc-fix-current)
" Run the Code Lens action on the current line.
nmap <leader>cl <Plug>(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 <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
" Remap keys for gotos
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Apply AutoFix to problem on the current line.
nmap <leader>qf <Plug>(coc-fix-current)
" Map function and class text objects
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
xmap if <Plug>(coc-funcobj-i)
omap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap af <Plug>(coc-funcobj-a)
xmap ic <Plug>(coc-classobj-i)
omap ic <Plug>(coc-classobj-i)
xmap ac <Plug>(coc-classobj-a)
omap ac <Plug>(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 <silent> <buffer> <esc> <c-\><c-n>
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 <silent> L :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
elseif (coc#rpc#ready())
call CocActionAsync('doHover')
else
execute '!' . &keywordprg . " " . expand('<cword>')
endif
endfunction
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
" Apply AutoFix to problem on the current line.
nmap <leader>qf <Plug>(coc-fix-current)
nmap zg :CocCommand cSpell.addWordToDictionary<CR>
" Mappings for CoCList
" Show all diagnostics.
nnoremap <silent><nowait> <space>a :<C-u>CocList diagnostics<cr>
" Manage extensions.
nnoremap <silent><nowait> <space>e :<C-u>CocList extensions<cr>
" Show commands.
nnoremap <silent><nowait> <space>c :<C-u>CocList commands<cr>
" Find symbol of current document.
nnoremap <silent><nowait> <space>o :<C-u>CocList outline<cr>
" Search workspace symbols.
nnoremap <silent><nowait> <space>s :<C-u>CocList -I symbols<cr>
" Do default action for next item.
nnoremap <silent><nowait> <space>j :<C-u>CocNext<CR>
" Do default action for previous item.
nnoremap <silent><nowait> <space>k :<C-u>CocPrev<CR>
" Resume latest coc list.
nnoremap <silent><nowait> <space>p :<C-u>CocListResume<CR>

View File

@ -1,42 +0,0 @@
" -------- CTRL-P --------
let g:ctrlp_map = '<c-o>'
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

View File

@ -1,30 +0,0 @@
"nnoremap <silent> <C-p> :FZF -m<cr>
"let $FZF_DEFAULT_COMMAND = 'ag -g ""'
" nmap <C-P> :FZF<CR>
nmap <leader><tab> <plug>(fzf-maps-n)
xmap <leader><tab> <plug>(fzf-maps-x)
omap <leader><tab> <plug>(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 <silent> <c-s-t> :FzfHgFiles<CR>
" nnoremap <silent> <c-s-f> :FzfHgRg<space>
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,
\ }),
\ <bang>0
\ )
command! -bang -nargs=* ClSearch
\ call fzf#vim#grep(
\ s:rg_command . " " . <q-args> . " " . "$(" . s:hg_command . ")", 1,
\ <bang>0 ? fzf#vim#with_preview('up:60%')
\ : fzf#vim#with_preview('right:50%'),
\ <bang>0)

View File

View File

@ -18,20 +18,12 @@ vmap <leader>` c`<C-R>"`<ESC>
" unhilight search
nnoremap <leader><space> :nohlsearch<CR>
" EZ Ack search
" nnoremap <leader>a :Ack!<Space>
" nnoremap <leader>A :Ack!<Space> <C-r><C-w>
" --------- CLIPBOARD MAPPINGS ---------
" Paste from OS clipboard
map <leader>v i<ESC>"+pa<ESC>
vmap <leader>v c<ESC>"+p<ESC>
imap <leader>v <ESC>"+pa
" Copy to OS clipboard
" vnoremap <leader>y "yy <Bar> :call system('xclip', @y)<CR>
" map <leader>y "yy <Bar> :call system('xclip', @y)<CR>
" --------- WINDOW/PANE MAPPINGS ---------
map <leader>wr <C-W>r
map <leader>H :wincmd H<cr>
@ -48,31 +40,11 @@ nnoremap <silent> <Leader>s- :exe "vertical resize " . (winwidth(0) * 4/5)<CR>
nnoremap <silent> <Leader>x+ :exe "resize " . (winheight(0) * 3/2)<CR>
nnoremap <silent> <Leader>x- :exe "resize " . (winheight(0) * 2/3)<CR>
" --------- FORMATTING MAPPINGS ---------
" indent file
map <leader>= gg=G ``
" format HTML/JSON
map <leader>fh :%s/>\s*</>\r</g<cr>
map <leader>fj :%!python -m json.tool<cr>
map <leader>fjs :call UnMinify()<cr>
"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 <leader>toi :CocCommand tsserver.organizeImports<cr>
nmap <leader>yf :let @+ = expand("%")<cr>
nmap <leader>ut :UndotreeToggle<cr>
nmap <leader>e :e %%
" replace currently selected text with default register
@ -81,16 +53,6 @@ vnoremap <leader>p "_dP
nnoremap <leader>rp :VimuxOpenRunner<cr> :VimuxRunCommand '!!'<cr> :call VimuxSendKeys("Enter")<cr>
"Showing highlight groups
" nmap <leader>sp :call <SID>SynStack()<CR>
nmap <leader>shg :call <SID>SynStack()<CR>
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
nnoremap <leader>s :SessionSave<CR>
" copy to attached terminal using the yank(1) script:

View File

@ -1,36 +0,0 @@
Glug youcompleteme-google
let g:ycm_key_invoke_completion = '<C-Space>'
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 <silent> gd :YcmCompleter GoToDeclaration<CR>
nmap <silent> gt :YcmCompleter GetType<CR>
nmap <silent> gr :YcmCompleter GoToReferences<CR>
nmap <leader>qf :YcmCompleter FixIt<CR>
nmap <leader>rn :YcmCompleter RefactorRename<space>
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 <silent> <leader>D :call <SID>Hover()<CR>
nnoremap <silent> <leader>D <plug>(YCMHover)