nvim: Remove cartographer plugin
Switch to use the nice new nvim-internal keymapping functions. Cartographer was a really useful plugin when they did not yet exist but now everything I wanted to do can be done without a mapping plugin, so it is time to remove it.
This commit is contained in:
parent
08360ae7ff
commit
fff6e60862
4 changed files with 103 additions and 195 deletions
|
@ -1,52 +0,0 @@
|
||||||
" set up fzf-bibtex
|
|
||||||
let g:fzf_bibtex_cache = '~/.cache/'
|
|
||||||
let g:fzf_bibtex_sources = g:pandoc#biblio#bibs
|
|
||||||
|
|
||||||
" prepare bibtex_ls function to look for bib files in cwd/parent/subdirs,
|
|
||||||
" attach the standard bibtex source file
|
|
||||||
" return the command with standard cache directory filled
|
|
||||||
function! s:bibtex_ls(...)
|
|
||||||
let bibfiles = (
|
|
||||||
\ globpath('.', '*.bib', v:true, v:true) +
|
|
||||||
\ globpath('..', '*.bib', v:true, v:true) +
|
|
||||||
\ globpath('*/', '*.bib', v:true, v:true)
|
|
||||||
\ )
|
|
||||||
let bibfiles = join(bibfiles, ' ')
|
|
||||||
let source_cmd = 'bibtex-ls -cache ' . g:fzf_bibtex_cache . ' ' .bibfiles . ' ' . join(g:fzf_bibtex_sources)
|
|
||||||
return source_cmd
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" NORMAL MODE CITATION
|
|
||||||
" insert citation from normal mode at cursor (with brackets)
|
|
||||||
function! s:bibtex_cite_sink(lines)
|
|
||||||
let r=system("bibtex-cite ", a:lines)
|
|
||||||
execute ':normal! i[' . r . ']'
|
|
||||||
endfunction
|
|
||||||
command! -bang -nargs=* CiteRef call fzf#run(fzf#wrap({
|
|
||||||
\ 'source': <sid>bibtex_ls(<q-args>),
|
|
||||||
\ 'sink*': function('<sid>bibtex_cite_sink'),
|
|
||||||
\ 'up': '25%',
|
|
||||||
\ 'options': '--ansi --multi --prompt "Cite> "'
|
|
||||||
\ }))
|
|
||||||
|
|
||||||
" INSERT MODE CITATION
|
|
||||||
" insert citation from insert mode at cursor (no brackets inserted)
|
|
||||||
function! s:bibtex_cite_sink_insert(lines)
|
|
||||||
let r=system("bibtex-cite ", a:lines)
|
|
||||||
execute ':normal! i' . r
|
|
||||||
call feedkeys('a', 'n')
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
" MARKDOWN CITATION
|
|
||||||
" insert markdown formatted reference
|
|
||||||
function! s:bibtex_markdown_sink(lines)
|
|
||||||
let r=system("bibtex-markdown -cache " . g:fzf_bibtex_cache . ' ' . join(g:fzf_bibtex_sources), a:lines)
|
|
||||||
echo join(a:lines, '; ')
|
|
||||||
execute ':normal! a' . r
|
|
||||||
endfunction
|
|
||||||
command! -bang -nargs=* CiteMarkdown call fzf#run(fzf#wrap({
|
|
||||||
\ 'source': <sid>bibtex_ls(),
|
|
||||||
\ 'sink*': function('<sid>bibtex_markdown_sink'),
|
|
||||||
\ 'up': '25%',
|
|
||||||
\ 'options': '--ansi --multi --prompt "Markdown> "'
|
|
||||||
\ }))
|
|
|
@ -33,7 +33,6 @@
|
||||||
"notational-fzf-vim": { "branch": "master", "commit": "75c2c31e7cd77397018c5777804666d648557537" },
|
"notational-fzf-vim": { "branch": "master", "commit": "75c2c31e7cd77397018c5777804666d648557537" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "d147222a1300901656f3ebd5b95f91732785a329" },
|
"nui.nvim": { "branch": "main", "commit": "d147222a1300901656f3ebd5b95f91732785a329" },
|
||||||
"nvim-base16.lua": { "branch": "master", "commit": "b336f40462b3ca1ad16a17c195b83731a2942d9a" },
|
"nvim-base16.lua": { "branch": "master", "commit": "b336f40462b3ca1ad16a17c195b83731a2942d9a" },
|
||||||
"nvim-cartographer": { "branch": "master", "commit": "fbe977c9529019376db9426cccf04bfdadeafc69" },
|
|
||||||
"nvim-cmp": { "branch": "main", "commit": "cfafe0a1ca8933f7b7968a287d39904156f2c57d" },
|
"nvim-cmp": { "branch": "main", "commit": "cfafe0a1ca8933f7b7968a287d39904156f2c57d" },
|
||||||
"nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" },
|
"nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "aeb76066212b09c7c01a3abb42fe82f0130ef402" },
|
"nvim-lspconfig": { "branch": "master", "commit": "aeb76066212b09c7c01a3abb42fe82f0130ef402" },
|
||||||
|
|
|
@ -1,34 +1,30 @@
|
||||||
local map = require 'cartographer'
|
local map = vim.keymap.set
|
||||||
|
|
||||||
-- The general ideas behind these mappings:
|
-- The general ideas behind these mappings:
|
||||||
--
|
--
|
||||||
-- * Leader prefix is the generally preferred way to map new things, however
|
-- * Leader prefix is the generally preferred way to map new things, however
|
||||||
-- only for those that affect all of vim
|
-- only for those that affect all of vim of work in a supra-buffer way.
|
||||||
--
|
--
|
||||||
-- * Localleader prefix is used for mappings which only affect single buffers,
|
-- * Localleader prefix is used for mappings which only affect single buffers.
|
||||||
-- in other words mostly filetype specific mappings
|
-- In other words mostly filetype specific mappings
|
||||||
--
|
|
||||||
-- many of these mapping ideas come from Tom Ryder who has them nicely
|
|
||||||
-- documented
|
|
||||||
|
|
||||||
-- backspace to switch to alternate (last) buffer
|
-- backspace to switch to alternate (last) buffer
|
||||||
map.n.nore['<BS>'] = '<C-^>'
|
map('n', '<BS>', '<C-^>')
|
||||||
|
|
||||||
-- since u undoes, would it not make sense that U redoes?
|
-- since u undoes, would it not make sense that U redoes?
|
||||||
map.n.nore['U'] = '<C-r>'
|
map('n', 'U', '<C-r>')
|
||||||
|
|
||||||
-- d-motion puts the last 'deleted' thing into the default register to paste;
|
-- d-motion puts the last 'deleted' thing into the default register to paste;
|
||||||
-- use D-motion to truly delete something into nothingness and keep whatever
|
-- use D-motion to truly delete something into nothingness and keep whatever
|
||||||
-- you want in your register, ready to paste
|
-- you want in your register, ready to paste
|
||||||
map.n.nore['D'] = '"_d'
|
map('n', 'D', '"_d')
|
||||||
|
|
||||||
-- I don't particularly need ex mode (at least, yet) but faster macro access
|
-- I don't particularly need ex mode (at least, yet) but faster macro access is nice
|
||||||
-- is nice
|
map('n', 'Q', '@')
|
||||||
map.n.nore['Q'] = '@'
|
|
||||||
|
|
||||||
-- stronger versions of left,right - move all the way to beginning/end of line
|
-- stronger versions of left,right - move all the way to beginning/end of line
|
||||||
map.n.nore['H'] = '^'
|
map('n', 'H', '^')
|
||||||
map.n.nore['L'] = '$'
|
map('n', 'L', '$')
|
||||||
|
|
||||||
-- when in softwrapped files, allow moving through the visible lines with j/k
|
-- when in softwrapped files, allow moving through the visible lines with j/k
|
||||||
-- but when prepending a number jump *exactly* as many lines, wrapped or not
|
-- but when prepending a number jump *exactly* as many lines, wrapped or not
|
||||||
|
@ -44,41 +40,37 @@ local function wrap_down()
|
||||||
return 'j'
|
return 'j'
|
||||||
end
|
end
|
||||||
|
|
||||||
map.n.nore.expr['k'] = wrap_up
|
map('n', 'k', wrap_up, {expr = true})
|
||||||
map.n.nore.expr['j'] = wrap_down
|
map('n', 'j', wrap_down, {expr = true})
|
||||||
|
|
||||||
-- move around between matching brackets with tab
|
-- move around between matching brackets with tab
|
||||||
map.n.nore['<tab>'] = '%'
|
map('n', '<Tab>', '%')
|
||||||
|
|
||||||
-- when in insertion mode, C-u uppercases the current word, C-l lowercases it,
|
-- when in insertion mode, C-u uppercases the current word, C-l lowercases it,
|
||||||
map.i.nore['<C-u>'] = '<esc>gUiw`]a'
|
map('i', '<C-u>', '<esc>gUiw`]a')
|
||||||
map.i.nore['<C-l>'] = '<esc>guiw`]a'
|
map('i', '<C-y>', '<esc>guiw`]a')
|
||||||
|
|
||||||
-- let me save stuff as sudo when I forget to call vim with it
|
|
||||||
map.c.nore['w!!'] =
|
|
||||||
[[execute 'silent! write !sudo tee % >/dev/null' <bar> edit!]]
|
|
||||||
|
|
||||||
-- yank current filename/filepath to f buffer
|
-- yank current filename/filepath to f buffer
|
||||||
map.n.nore['yp'] = ':let @p = expand("%")<Cr>'
|
map('n', 'yp', ':let @p = expand("%")<Cr>')
|
||||||
map.n.nore['yP'] = ':let @p = expand("%:p")<Cr>'
|
map('n', 'yP', ':let @p = expand("%:p")<Cr>')
|
||||||
|
|
||||||
-- repeat the last substitute command with all its flags preserved
|
-- repeat the last substitute command with all its flags preserved
|
||||||
map.n.nore['&'] = ':&&<cr>'
|
map('n', '&', ':&&<cr>')
|
||||||
|
|
||||||
-- bracket pairings to go to the next/previous of:
|
-- bracket pairings to go to the next/previous of:
|
||||||
-- (works with count prefixes)
|
-- (works with count prefixes)
|
||||||
-- Argument list
|
-- Argument list
|
||||||
map.n.nore['[a'] = ':previous<cr>'
|
map('n', '[a', ':previous<cr>')
|
||||||
map.n.nore[']a'] = ':next<cr>'
|
map('n', ']a', ':next<cr>')
|
||||||
-- Buffers
|
-- Buffers
|
||||||
map.n.nore['[b'] = ':bprevious<cr>'
|
map('n', '[b', ':bprevious<cr>')
|
||||||
map.n.nore[']b'] = ':bnext<cr>'
|
map('n', ']b', ':bnext<cr>')
|
||||||
-- Quickfix list
|
-- Quickfix list
|
||||||
map.n.nore['[q'] = ':cprevious<cr>'
|
map('n', '[q', ':cprevious<cr>')
|
||||||
map.n.nore[']q'] = ':cnext<cr>'
|
map('n', ']q', ':cnext<cr>')
|
||||||
-- Location list
|
-- Location list
|
||||||
map.n.nore['[l'] = ':lprevious<cr>'
|
map('n', '[l', ':lprevious<cr>')
|
||||||
map.n.nore[']l'] = ':lnext<cr>'
|
map('n', ']l', ':lnext<cr>')
|
||||||
|
|
||||||
-- maps the leader for buffer local mappings
|
-- maps the leader for buffer local mappings
|
||||||
-- since we are (atm) using sneak to go fwd/bwd in fFtT searches, comma does
|
-- since we are (atm) using sneak to go fwd/bwd in fFtT searches, comma does
|
||||||
|
@ -87,180 +79,149 @@ vim.g.maplocalleader = ","
|
||||||
|
|
||||||
-- If we mapped localleader to comma, we can still get to its original function
|
-- If we mapped localleader to comma, we can still get to its original function
|
||||||
-- by douple-tapping it.
|
-- by douple-tapping it.
|
||||||
|
-- FIXME does this work still (and is it necessary)?
|
||||||
if vim.g.maplocalleader == ',' then
|
if vim.g.maplocalleader == ',' then
|
||||||
map.nore[',,'] = ','
|
map('', ',,', ',')
|
||||||
map.s[',,'] = nil
|
vim.keymap.del('', ',,', {silent=true})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- remove search highlights by pressing space+/
|
-- remove search highlights by pressing space+/
|
||||||
map.n.nore['<leader>/'] = ':noh<cr>'
|
map('n', '<leader>/', ':noh<cr>')
|
||||||
|
|
||||||
-- split buffers vertically/horizontally with the leader \ or - (mirrors my
|
-- split buffers vertically/horizontally with the leader \ or - (mirrors my
|
||||||
-- tmux setup)
|
-- tmux setup)
|
||||||
map.n.nore['<leader>-'] = ':sp<cr>'
|
map('n', '<leader>-', ':sp<cr>')
|
||||||
map.n.nore['<leader>\\'] = ':vsp<cr>'
|
map('n', '<leader>\\', ':vsp<cr>')
|
||||||
-- 'open new buffer' with leader-t (opens new buffer containing current dir and switches to it)
|
-- 'open new buffer' with leader-t (opens new buffer containing current dir and switches to it)
|
||||||
map.n.nore['<leader>t'] = ':vsp .<cr>'
|
map('n', '<leader>t', ':vsp .<cr>')
|
||||||
-- open actual new tab with leader-T
|
-- open actual new tab with leader-T
|
||||||
map.n.nore['<leader>T'] = ':tabedit .<cr>'
|
map('n', '<leader>T', ':tabedit .<cr>')
|
||||||
|
|
||||||
-- select the whole buffer with <leader>-a
|
-- select the whole buffer with <leader>-a
|
||||||
map.n.nore['<leader>a'] = 'ggVG'
|
map('n', '<leader>a', 'ggVG')
|
||||||
|
|
||||||
-- CONFIG EDITING
|
-- PLUGIN: Navigator.nvim
|
||||||
-- quickly edit vimrc with leader+V
|
map('n', '<c-w>h', '<CMD>lua require("Navigator").left()<cr>', {silent = true})
|
||||||
map.n.nore['<leader>V'] = ':vsp $MYVIMRC<cr>'
|
map('n', '<c-w>k', '<CMD>lua require("Navigator").up()<cr>', {silent = true})
|
||||||
-- source vimrc with keystroke combination
|
map('n', '<c-w>l', '<CMD>lua require("Navigator").right()<cr>', {silent = true})
|
||||||
map.n.nore['<leader>VV'] = ':source $MYVIMRC<cr>'
|
map('n', '<c-w>j', '<CMD>lua require("Navigator").down()<cr>', {silent = true})
|
||||||
|
map('n', '<c-w>p', '<CMD>lua require("Navigator").previous()<cr>', {silent = true})
|
||||||
|
|
||||||
-- PLUGIN: Vifm.vim
|
-- PLUGIN: Vifm.vim
|
||||||
-- open/close file tree with leader-e
|
-- open/close file tree with leader-e
|
||||||
map.n.nore['<leader>e'] = ':Vifm<cr>'
|
map('n', '<leader>e', ':Vifm<cr>')
|
||||||
-- open current file tree with current file directory
|
-- open current file tree with current file directory
|
||||||
map.n.nore['<leader>E'] = ':Vifm getcwd()<cr>'
|
map('n', '<leader>E', ':Vifm getcwd()<cr>')
|
||||||
|
|
||||||
-- PLUGIN: Telescope GLOBAL FUZZY FINDING
|
-- PLUGIN: Telescope GLOBAL FUZZY FINDING
|
||||||
-- buffers and files in current workdir
|
-- buffers and files in current workdir
|
||||||
map.n.nore['<leader>s'] =
|
map('n', '<leader>s',":lua require 'telescope.builtin'.buffers(require 'telescope.themes'.get_ivy())<cr>")
|
||||||
[[:lua require 'telescope.builtin'.buffers(require 'telescope.themes'.get_ivy())<cr>]]
|
|
||||||
-- most recently used / MRU, bound to S since it is essentially a larger
|
-- most recently used / MRU, bound to S since it is essentially a larger
|
||||||
-- go-back intention than just buffers
|
-- go-back intention than just buffers
|
||||||
map.n.nore['<leader>S'] =
|
map('n', '<leader>S',":lua require 'telescope.builtin'.oldfiles(require 'telescope.themes'.get_ivy())<cr>")
|
||||||
[[:lua require 'telescope.builtin'.oldfiles(require 'telescope.themes'.get_ivy())<cr>]]
|
|
||||||
-- fuzzy find files in cwd
|
-- fuzzy find files in cwd
|
||||||
map.n.nore['<leader>f'] = [[:lua require 'telescope.builtin'.find_files()<cr>]]
|
map('n', '<leader>f',":lua require 'telescope.builtin'.find_files()<cr>")
|
||||||
-- fuzzy find hidden files in cwd
|
-- fuzzy find hidden files in cwd
|
||||||
map.n.nore['<leader><c-f>'] =
|
map('n', '<leader><c-f>',":lua require 'telescope.builtin'.find_files({hidden=true})<cr>")
|
||||||
[[:lua require 'telescope.builtin'.find_files({hidden=true})<cr>]]
|
|
||||||
-- general full-text search in cwd with rg
|
-- general full-text search in cwd with rg
|
||||||
map.n.nore['<leader>F'] = [[:lua require 'telescope.builtin'.live_grep()<cr>]]
|
map('n', '<leader>F',":lua require 'telescope.builtin'.live_grep()<cr>")
|
||||||
|
|
||||||
-- git status
|
-- git status
|
||||||
map.n.nore['<leader>gs'] = [[:lua require 'telescope.builtin'.git_status()<cr>]]
|
map('n', '<leader>gs',":lua require 'telescope.builtin'.git_status()<cr>")
|
||||||
-- git buffercommits
|
-- git buffercommits
|
||||||
map.n.nore['<leader>gb'] =
|
map('n', '<leader>gb',":lua require 'telescope.builtin'.git_bcommits()<cr>")
|
||||||
[[:lua require 'telescope.builtin'.git_bcommits()<cr>]]
|
|
||||||
-- git commitlog
|
-- git commitlog
|
||||||
map.n.nore['<leader>gl'] =
|
map('n', '<leader>gl',":lua require 'telescope.builtin'.git_commits()<cr>")
|
||||||
[[:lua require 'telescope.builtin'.git_commits()<cr>]]
|
|
||||||
|
|
||||||
-- helptags
|
-- helptags
|
||||||
map.n.nore['<leader><F1>'] =
|
map('n', '<leader><F1>',":lua require 'telescope.builtin'.help_tags()<cr>")
|
||||||
[[:lua require 'telescope.builtin'.help_tags()<cr>]]
|
|
||||||
-- manpages
|
-- manpages
|
||||||
map.n.nore['<leader><F2>'] =
|
map('n', '<leader><F2>',":lua require 'telescope.builtin'.man_pages()<cr>")
|
||||||
[[:lua require 'telescope.builtin'.man_pages()<cr>]]
|
|
||||||
|
|
||||||
-- colorschemes
|
-- colorschemes
|
||||||
map.n.nore['<leader><F8>'] =
|
map('n', '<leader><F8>',":lua require 'telescope.builtin'.colorscheme(require 'telescope.themes'.get_ivy())<cr>")
|
||||||
[[:lua require 'telescope.builtin'.colorscheme(require 'telescope.themes'.get_ivy())<cr>]]
|
|
||||||
|
|
||||||
-- spell suggestions
|
-- spell suggestions
|
||||||
map.n.nore['z='] =
|
map('n', 'z=',":lua require 'telescope.builtin'.spell_suggest(require 'telescope.themes'.get_ivy())<cr>")
|
||||||
[[:lua require 'telescope.builtin'.spell_suggest(require 'telescope.themes'.get_ivy())<cr>]]
|
|
||||||
|
|
||||||
-- Note Searching
|
|
||||||
-- PLUGIN: Notational-FZF
|
|
||||||
-- set notational-fzf-vim keys for the NV window itself
|
|
||||||
vim.g.nv_fzf_binds = {
|
|
||||||
'alt-a:select-all', 'alt-q:deselect-all', 'alt-p:toggle-preview',
|
|
||||||
'alt-u:page-up', 'alt-d:page-down', 'ctrl-w:backward-kill-word'
|
|
||||||
}
|
|
||||||
-- FZF note full-text search with notational-velocity like functions (in wiki
|
|
||||||
-- directory)
|
|
||||||
map.n.nore['<leader>n'] = ':NV<cr>'
|
|
||||||
map.n.nore['<leader>N'] = ':NV!<cr>'
|
|
||||||
|
|
||||||
-- Format current Paragraph (esp useful in prose writing)
|
-- Format current Paragraph (esp useful in prose writing)
|
||||||
map.n.nore.silent['<localleader>q'] = 'gqap'
|
map('n', '<localleader>q', 'gqap', {silent=true})
|
||||||
map.x.nore.silent['<localleader>q'] = 'gq'
|
map('x', '<localleader>q', 'gq', {silent=true})
|
||||||
map.n.nore.silent['<localleader>Q'] = 'vapJgqap'
|
map('n', '<localleader>Q', 'vapJgqap', {silent=true})
|
||||||
|
|
||||||
map.n.silent['<localleader>mp'] = '<Plug>MarkdownPreviewToggle'
|
map('n', '<localleader>mp', '<Plug>MarkdownPreviewToggle')
|
||||||
|
|
||||||
-- FORMAT code with
|
-- FORMAT code with
|
||||||
-- PLUGIN: formatter.nvim
|
-- PLUGIN: formatter.nvim
|
||||||
map.n.nore.silent['<localleader>f'] = ':FormatLock<cr>'
|
map('n', '<localleader>f', ':FormatLock<cr>')
|
||||||
map.n.nore.silent['<localleader>F'] = ':FormatWriteLock<cr>'
|
map('n', '<localleader>F', ':FormatWriteLock<cr>')
|
||||||
|
|
||||||
-- Enter distraction free prose mode with F11
|
-- Enter distraction free prose mode with F11
|
||||||
map.n.nore.silent['<F11>'] = ':ZenMode<cr>'
|
map('n', '<F11>', ':ZenMode<cr>', {silent=true})
|
||||||
|
|
||||||
-- PLUGIN: fzf-bibtex
|
|
||||||
-- map @@ to automatically insert citation reference at cursor
|
|
||||||
map.i.nore.silent['@@'] = '<c-g>u<c-o>:CiteRef<cr>'
|
|
||||||
-- map <leader>cc to insert a complete citation at cursor
|
|
||||||
|
|
||||||
-- SPELL CHECKING
|
-- SPELL CHECKING
|
||||||
-- Move to the prev/next spelling error with [S ]S
|
-- Move to the prev/next spelling error with [S ]S
|
||||||
-- Move to the prev/next spelling error or suggestion with [s ]s
|
-- Move to the prev/next spelling error or suggestion with [s ]s
|
||||||
map.n.nore['<localleader>ZZ'] = ':setlocal spell! spelllang=en_us,de_de<cr>'
|
map('n', '<localleader>ZZ', ':setlocal spell! spelllang=en_us,de_de<cr>')
|
||||||
map.n.nore['<localleader>ZE'] = ':setlocal spell! spelllang=en_us<cr>'
|
map('n', '<localleader>ZE', ':setlocal spell! spelllang=en_us<cr>')
|
||||||
map.n.nore['<localleader>ZG'] = ':setlocal spell! spelllang=de_de<cr>'
|
map('n', '<localleader>ZG', ':setlocal spell! spelllang=de_de<cr>')
|
||||||
-- undo last spelling mistake from insert and normal mode
|
-- undo last spelling mistake from insert and normal mode
|
||||||
map.i.nore['<c-s>'] = '<C-G>u<Esc>[s1z=`]a<C-G>u'
|
map('i', '<c-s>', '<C-G>u<Esc>[s1z=`]a<C-G>u')
|
||||||
map.n.nore['<localleader>s'] = 'ms[s1z=`s'
|
map('n', '<localleader>s', 'ms[s1z=`s')
|
||||||
|
|
||||||
-- PLUGIN: easy-align
|
-- PLUGIN: easy-align
|
||||||
-- Start interactive EasyAlign in visual mode (e.g. vipga)
|
-- Start interactive EasyAlign in visual mode (e.g. vipga)
|
||||||
map.x['ga'] = '<Plug>(EasyAlign)'
|
map('x', 'ga', '<Plug>(EasyAlign)')
|
||||||
-- Start interactive EasyAlign for a motion/text object (e.g. gaip)
|
-- Start interactive EasyAlign for a motion/text object (e.g. gaip)
|
||||||
map.n['ga'] = '<Plug>(EasyAlign)'
|
map('n', 'ga', '<Plug>(EasyAlign)')
|
||||||
|
|
||||||
-- PLUGIN: Navigator.nvim
|
-- PLUGIN: vnsip
|
||||||
map.n.nore.silent['<c-w>h'] = "<CMD>lua require('Navigator').left()<CR>"
|
-- jump around in snippets
|
||||||
map.n.nore.silent['<c-w>k'] = "<CMD>lua require('Navigator').up()<CR>"
|
map('i', '<Tab>', [[vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : '<Tab>']], {expr=true})
|
||||||
map.n.nore.silent['<c-w>l'] = "<CMD>lua require('Navigator').right()<CR>"
|
map('i', '<S-Tab>', [[vsnip#jumpable(-1) ? '<Plug>(vsnip-jump-next)' : '<S-Tab>']], {expr=true})
|
||||||
map.n.nore.silent['<c-w>j'] = "<CMD>lua require('Navigator').down()<CR>"
|
|
||||||
map.n.nore.silent['<c-w>p'] = "<CMD>lua require('Navigator').previous()<CR>"
|
|
||||||
|
|
||||||
-- PLUGIN: compe.nvim
|
|
||||||
-- lsp keymaps are set in lsp settings, only for lsp buffers
|
|
||||||
map.i.nore.expr.silent['<c-space>'] = 'compe#complete()'
|
|
||||||
map.i.expr['<Tab>'] =
|
|
||||||
[[vsnip#jumpable(1) ? '<Plug>(vsnip-jump-next)' : '<Tab>']]
|
|
||||||
map.i.expr['<S-Tab>'] =
|
|
||||||
[[vsnip#jumpable(-1) ? '<Plug>(vsnip-jump-next)' : '<S-Tab>']]
|
|
||||||
|
|
||||||
-- PLUGIN: symbols-outline.nvim
|
-- PLUGIN: symbols-outline.nvim
|
||||||
map.n.nore.silent['<leader>o'] = "<cmd>SymbolsOutline<cr>"
|
map('n', '<leader>o', '<cmd>SymbolsOutline<cr>', {silent=true})
|
||||||
|
|
||||||
-- trim trailing whitespaces with mini.nvim trailspace
|
-- trim trailing whitespaces with mini.nvim trailspace
|
||||||
vim.keymap.set("n", "<localleader>w", function() require("mini.trailspace").trim() end, {noremap = true})
|
map("n", "<localleader>w", function() require("mini.trailspace").trim() end, {noremap = true})
|
||||||
|
|
||||||
-- PLUGIN: dial-increment
|
-- PLUGIN: dial-increment
|
||||||
vim.keymap.set("n", "<C-a>", require("dial.map").inc_normal(), {noremap = true})
|
map("n", "<C-a>", require("dial.map").inc_normal(), {noremap = true})
|
||||||
vim.keymap.set("n", "<C-x>", require("dial.map").dec_normal(), {noremap = true})
|
map("n", "<C-x>", require("dial.map").dec_normal(), {noremap = true})
|
||||||
vim.keymap.set("v", "<C-a>", require("dial.map").inc_visual(), {noremap = true})
|
map("v", "<C-a>", require("dial.map").inc_visual(), {noremap = true})
|
||||||
vim.keymap.set("v", "<C-x>", require("dial.map").dec_visual(), {noremap = true})
|
map("v", "<C-x>", require("dial.map").dec_visual(), {noremap = true})
|
||||||
vim.keymap.set("v", "g<C-a>",require("dial.map").inc_gvisual(), {noremap = true})
|
map("v", "g<C-a>",require("dial.map").inc_gvisual(), {noremap = true})
|
||||||
vim.keymap.set("v", "g<C-x>",require("dial.map").dec_gvisual(), {noremap = true})
|
map("v", "g<C-x>",require("dial.map").dec_gvisual(), {noremap = true})
|
||||||
|
|
||||||
-- PLUGIN: zettelkasten.nvim
|
-- PLUGIN: zettelkasten.nvim
|
||||||
map.n.nore['<cr>'] = [[:silent lua require 'zettelkasten'.link_follow()<cr>]]
|
map('n', '<cr>', [[:silent lua require 'zettelkasten'.link_follow()<cr>]])
|
||||||
map.v.nore['<cr>'] = [[:lua require 'zettelkasten'.link_follow(true)<cr>]]
|
map('v', '<cr>', [[:lua require 'zettelkasten'.link_follow(true)<cr>]])
|
||||||
map.n.nore['<leader>ww'] = [[:lua require 'zettelkasten'.index_open()<cr> ]]
|
map('n', '<leader>ww', [[:lua require 'zettelkasten'.index_open()<cr> ]])
|
||||||
|
|
||||||
-- PLUGIN: toggleterm.nvim
|
-- PLUGIN: toggleterm.nvim
|
||||||
-- create a lazygit window, set up in toggleterm settings
|
-- create a lazygit window, set up in toggleterm settings
|
||||||
map.n.nore['<leader>G'] = ':Lazygit<cr>'
|
map('n', '<leader>G', ':Lazygit<cr>')
|
||||||
|
|
||||||
-- PLUGIN: magma-nvim
|
-- PLUGIN: magma-nvim
|
||||||
-- Operate jupyter notebooks from within vim
|
-- Operate jupyter notebooks from within vim
|
||||||
map.n.nore.silent['<localleader>rr'] = ':MagmaEvaluateLine<cr>'
|
map('n', '<localleader>mm', ':MagmaEvaluateLine<cr>', {silent=true})
|
||||||
map.n.nore.silent['<localleader>R'] = '?^```{<cr>jV/```<cr>k:<C-u>MagmaEvaluateVisual<cr>'
|
map('n', '<localleader>M', '?^```{<cr>jV/```<cr>k:<C-u>MagmaEvaluateVisual<cr>', {silent=true})
|
||||||
map.x.nore.silent['<localleader>r'] = ':<C-u>MagmaEvaluateVisual<cr>'
|
map('x', '<localleader>m', ':<C-u>MagmaEvaluateVisual<cr>', {silent=true})
|
||||||
map.n.nore.expr.silent['<localleader>r'] = "nvim_exec('MagmaEvaluateOperator', v:true)"
|
map('n', '<localleader>m', "nvim_exec('MagmaEvaluateOperator', v:true)", {expr=true, silent=true})
|
||||||
map.n.nore.silent['<localleader>re'] = ':MagmaReevaluateCell<cr>'
|
map('n', '<localleader>mr', ':MagmaReevaluateCell<cr>', {silent=true})
|
||||||
map.n.nore.silent['<localleader>ro'] = ':MagmaShowOutput<cr>'
|
map('n', '<localleader>ma', ':MagmaShowOutput<cr>', {silent=true})
|
||||||
map.n.nore.silent['<localleader>rq'] = ':noautocmd :MagmaEnterOutput<cr>'
|
map('n', '<localleader>mq', ':noautocmd :MagmaEnterOutput<cr>', {silent=true})
|
||||||
map.n.nore.silent['<localleader>rc'] = ':MagmaDelete<cr>'
|
map('n', '<localleader>md', ':MagmaDelete<cr>', {silent=true})
|
||||||
map.n.nore.silent['<localleader>rd'] = ':MagmaInterrupt<cr>'
|
map('n', '<localleader>ms', ':MagmaInterrupt<cr>')
|
||||||
|
map('n', '<localleader>mI', ':MagmaInit ')
|
||||||
|
map('n', '<localleader>mD', ':MagmaDeinit<cr>')
|
||||||
|
map('n', '<localleader>mR', ':MagmaRestart<cr>')
|
||||||
|
|
||||||
map.n.nore.silent['<localleader>rO'] = ':lua vim.g.magma_automatically_open_output = not(vim.g.magma_automatically_open_output)<cr>'
|
|
||||||
-- jump to beginning of previous/ next cell code
|
-- jump to beginning of previous/ next cell code
|
||||||
map.n.nore[']r'] = '/^```{<cr>}:nohl<cr>'
|
map('n', ']c', '/^```{<cr>}:nohl<cr>')
|
||||||
map.n.nore['[r'] = '?^```n<cr>}:nohl<cr>'
|
map('n', '[c', '?^```<cr>n}:nohl<cr>')
|
||||||
-- insert cell header above/below
|
-- insert cell header above/below
|
||||||
map.n.nore['<leader>cO'] = ':IPythonCellInsertAbove<cr>a'
|
map('n', '<localleader>mo', 'o```{python}<cr><cr>```<esc>k')
|
||||||
map.n.nore['<leader>co'] = ':IPythonCellInsertBelow<cr>a'
|
map('n', '<localleader>mO', 'O```{python}<cr><cr>```<esc>k')
|
||||||
|
|
|
@ -82,7 +82,7 @@ return {
|
||||||
'echasnovski/mini.nvim',
|
'echasnovski/mini.nvim',
|
||||||
version = '*',
|
version = '*',
|
||||||
config = function() require('plug._mini') end
|
config = function() require('plug._mini') end
|
||||||
}, {'Iron-E/nvim-cartographer'}, -- makes it easier to set mappings through lua
|
},
|
||||||
{
|
{
|
||||||
"akinsho/nvim-toggleterm.lua", -- simpler, programmable and multiple terminal toggling for nvim
|
"akinsho/nvim-toggleterm.lua", -- simpler, programmable and multiple terminal toggling for nvim
|
||||||
config = function() require('plug._toggleterm') end,
|
config = function() require('plug._toggleterm') end,
|
||||||
|
|
Loading…
Reference in a new issue