Skip to content

Commit

Permalink
vim: move all motions to plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
gauravjuvekar committed Jan 16, 2024
1 parent 816b466 commit 988d328
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 43 deletions.
2 changes: 2 additions & 0 deletions after/plugin/motion.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
" Use \w, etc to go to the next camel word
call camelcasemotion#CreateMotionMappings('<leader>')
16 changes: 0 additions & 16 deletions lua/rc_lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,3 @@ local servers = {
for lsp, conf in ipairs(servers) do
lspconfig[lsp].setup(require("coq").lsp_ensure_capabilities(conf))
end

vim.keymap.set("n", "[e", vim.diagnostic.goto_prev)
vim.keymap.set("n", "]e", vim.diagnostic.goto_next)

vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev)
-- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { buffer = ev.buf }
vim.keymap.set("n", "<leader>gD", vim.lsp.buf.declaration, opts)
vim.keymap.set("n", "<leader>gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "<leader>gr", vim.lsp.buf.references, opts)
vim.keymap.set("n", "<leader>gi", vim.lsp.buf.implementation, opts)
end,
})
15 changes: 15 additions & 0 deletions plugin/motion.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
vim.keymap.set("n", "[e", vim.diagnostic.goto_prev)
vim.keymap.set("n", "]e", vim.diagnostic.goto_next)

vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev)
-- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { buffer = ev.buf }
vim.keymap.set("n", "<leader>gD", vim.lsp.buf.declaration, opts)
vim.keymap.set("n", "<leader>gd", vim.lsp.buf.definition, opts)
vim.keymap.set("n", "<leader>gr", vim.lsp.buf.references, opts)
vim.keymap.set("n", "<leader>gi", vim.lsp.buf.implementation, opts)
end,
})
7 changes: 7 additions & 0 deletions plugin/motion.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
" vim-easymotion
let g:EasyMotion_smartcase = 1
nmap f <Plug>(easymotion-overwin-f)
" gitgutter
nmap ]h <Plug>(GitGutterNextHunk)
nmap [h <Plug>(GitGutterPrevHunk)
27 changes: 0 additions & 27 deletions vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,6 @@ let g:easy_align_delimiters = {
\}


nmap ]h <Plug>(GitGutterNextHunk)
nmap [h <Plug>(GitGutterPrevHunk)

"python indents
let g:pyindent_continue = '&sw'
let g:pyindent_open_paren = '&sw'
Expand Down Expand Up @@ -244,10 +240,6 @@ let g:file_line_crosshairs=0
" Autoinsert current time with tnow
iab tnow <c-r>=strftime("%FT%T%z")<cr>

" vim-easymotion
let g:EasyMotion_smartcase = 1
nmap f <Plug>(easymotion-overwin-f)
" large file support
let g:hugefile_trigger_size = 256 "MB

Expand All @@ -269,17 +261,6 @@ let g:GtagsCscope_Quiet = 1
"let g:gutentags_plus_nomap = 1
"let g:gutentags_plus_switch = 1

" noremap <silent> <leader>gs :GscopeFind s <C-R><C-W><cr>
" noremap <silent> <leader>gg :GscopeFind g <C-R><C-W><cr>
" noremap <silent> <leader>gc :GscopeFind c <C-R><C-W><cr>
" noremap <silent> <leader>gt :GscopeFind t <C-R><C-W><cr>
" noremap <silent> <leader>ge :GscopeFind e <C-R><C-W><cr>
" noremap <silent> <leader>gf :GscopeFind f <C-R>=expand("<cfile>")<cr><cr>
" noremap <silent> <leader>gi :GscopeFind i <C-R>=expand("<cfile>")<cr><cr>
" noremap <silent> <leader>gd :GscopeFind d <C-R><C-W><cr>
" noremap <silent> <leader>ga :GscopeFind a <C-R><C-W><cr>


" clang-rename
" let g:clang_rename_path = "/usr/share/clang/clang-rename.py"
" noremap <leader>r :py3f /usr/share/clang/clang-rename.py<cr>
Expand All @@ -306,11 +287,3 @@ let g:tex_flavor='latex'

" Don't use non-ASCII7 symbols for puml previews
let g:slumlord_asciiart_utf=0

" Load all packages, so that we can use their defined functions in the rest of
" the config below.
packloadall


" Use \w, etc to go to the next camel word
call camelcasemotion#CreateMotionMappings('<leader>')

0 comments on commit 988d328

Please sign in to comment.