diff --git a/nvim/.config/nvim/after/plugin/prose.vim b/nvim/.config/nvim/after/plugin/prose.vim index c4dd1a6..b0c512d 100644 --- a/nvim/.config/nvim/after/plugin/prose.vim +++ b/nvim/.config/nvim/after/plugin/prose.vim @@ -1,9 +1,7 @@ " PROSE: function to automatically enables markdown plugins for md & txt files function! s:Prose() - call plug#load('vim-pencil') call plug#load('goyo.vim') call plug#load('limelight.vim') - call pencil#init() " PLUGIN: vim-textobj-sentence " enable extended sentence textobject use on md and plaintext files call textobj#sentence#init() diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index 74ef82c..f9573d9 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -77,7 +77,6 @@ Plug 'kana/vim-textobj-user' Plug 'reedes/vim-textobj-sentence' " extends the capabilities of sentence detection " and allows you to jump to the *end* of this or last sentence. -Plug 'reedes/vim-pencil', { 'for': ['pandoc', 'markdown', 'txt'], 'on': 'Goyo' } " provide md convenience functions like hard/softwrap Plug 'junegunn/goyo.vim', { 'for': ['pandoc', 'markdown', 'txt'], 'on': 'Goyo' } " provide distraction free writing Plug 'junegunn/limelight.vim', { 'for': ['pandoc', 'markdown', 'txt'], 'on': 'Goyo' } " provide even distraction free-er writing (lowlight paragraphs) " Language Integration diff --git a/nvim/.config/nvim/maps.vim b/nvim/.config/nvim/maps.vim index 1cc7ccb..550c716 100644 --- a/nvim/.config/nvim/maps.vim +++ b/nvim/.config/nvim/maps.vim @@ -29,6 +29,13 @@ nnoremap Q @ nnoremap H ^ nnoremap L $ +" 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 +" This makes relative linenumbers much more useful in prose docs since they +" are always exactly correct +nnoremap k (v:count == 0 ? 'gk' : 'k') +nnoremap j (v:count == 0 ? 'gj' : 'j') + " move around between matching brackets with tab nnoremap % nnoremap % @@ -254,12 +261,10 @@ vnoremap zt "ky:ThesaurusQueryReplace k " o to open the resulting document (mostly for pdfs) " po to comPile *and* open a doc " and all the same in uppercase for verbose output -nnoremap pp :DocCompile -nnoremap PP :DocCompile! -nnoremap po :DocCompileOpen -nnoremap PO :DocCompileOpen! -nnoremap o :DocOpen -nnoremap O :DocOpen! +nnoremap dp :DocCompile +nnoremap dP :DocCompile! +nnoremap do :DocOpen +nnoremap dO :DocOpen! " PLUGIN: easy-align " Start interactive EasyAlign in visual mode (e.g. vipga) diff --git a/nvim/.config/nvim/plugin/vim-pandoc.vim b/nvim/.config/nvim/plugin/vim-pandoc.vim index c217927..faf946e 100644 --- a/nvim/.config/nvim/plugin/vim-pandoc.vim +++ b/nvim/.config/nvim/plugin/vim-pandoc.vim @@ -5,6 +5,9 @@ let g:pandoc#filetypes#pandoc_markdown = 1 let g:pandoc#filetypes#handled = [ "extra", "latex", "markdown", "pandoc", "rst", "textile" ] " disable all default keymaps let g:pandoc#keyboard#use_default_mappings=0 +" needs to be set for wrapping and unwrapping of lines to work when doing j/k +" or gj/gk respectively, to allow precise relative cursor jumping +let g:pandoc#keyboard#display_motions=0 let g:pandoc#hypertext#use_default_mappings=0 " if there's a pdf and an html or similar, open the pdf let g:pandoc#command#prefer_pdf=1 diff --git a/nvim/.config/nvim/plugin/vim-pencil.vim b/nvim/.config/nvim/plugin/vim-pencil.vim deleted file mode 100644 index 097427e..0000000 --- a/nvim/.config/nvim/plugin/vim-pencil.vim +++ /dev/null @@ -1,4 +0,0 @@ -" PLUGIN: vim-pencil -" set default wrap mode to hard - TODO test which mode works better for -" me, it seems hardmode has trouble with markdown lists (see issue #31) -let g:pencil#wrapModeDefault = 'soft' " default is 'hard'