From 44022bcd65a1e3683ffc0b2cbab7c7bfce528c6f Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sat, 14 Jan 2017 22:02:34 +0100 Subject: Replace `vimwiki` with custom solution based on selected plugins and `rofi` --- bin/rofi_wiki | 9 +++++++++ i3wm/.i3/config | 16 ++++++++-------- vim/.vimrc | 23 +++++++++-------------- 3 files changed, 26 insertions(+), 22 deletions(-) create mode 100755 bin/rofi_wiki diff --git a/bin/rofi_wiki b/bin/rofi_wiki new file mode 100755 index 0000000..185f47a --- /dev/null +++ b/bin/rofi_wiki @@ -0,0 +1,9 @@ +#!/bin/sh + +name=$(find ~/wiki/*.wiki -printf "%f\n" | sed -e 's:\.[^./]*$::' | rofi -dmenu -p 'wiki:') + +if ! [[ -z $name ]] +then + i3-msg '[title="VimWiki"]' scratchpad show + exec gvim --servername VIMWIKI --remote ~/wiki/$name.wiki +fi diff --git a/i3wm/.i3/config b/i3wm/.i3/config index 2da59f6..c8aa728 100644 --- a/i3wm/.i3/config +++ b/i3wm/.i3/config @@ -102,10 +102,10 @@ client.unfocused #222222 #222222 #999999 client.urgent #a5a5a5 #a5a5a5 #2e3436 client.background #161616 -for_window [class="^.*"] border pixel 4 -for_window [title="^dictionary$"] floating enable -for_window [title="^.*\.wiki \(~\/note.*\).*GVIM$"] border pixel 8; floating enable; move to scratchpad -for_window [title="^.*- Zeal$"] border pixel 8; floating enable; move position 160px 46px; move to scratchpad +for_window [class="^.*"] border pixel 4 +for_window [title="^dictionary$"] floating enable +for_window [title="VimWiki"] border pixel 8; floating enable; move to scratchpad +for_window [title="^.*- Zeal$"] border pixel 8; floating enable; move position 160px 46px; move to scratchpad bindsym Control+Return exec urxvtc -title "Chicken Scheme REPL" -e csi -q bindsym $mod+Return exec urxvtc @@ -125,10 +125,10 @@ bindsym Control+Mod1+t exec --no-startup-id ~/.screenlayout/docked_tv_mode.sh bindsym $mod+c exec = bindsym $mod+t exec ~/.i3/apply_layout.sh -bindsym $mod+n [title="^.*\.wiki \(~\/note.*\).*GVIM$"] scratchpad show -bindsym $mod+z [title="^.*- Zeal$"] scratchpad show +bindsym Control+n exec rofi_wiki -bindsym $alt+n exec --no-startup-id sh -c "echo -e \$(xsel -o) '\n' >> ~/note/src/misc/inbox.wiki" +bindsym $mod+z [title="^.*- Zeal$"] scratchpad show +bindsym $mod+n [title="VimWiki"] scratchpad show exec --no-startup-id export $(gnome-keyring-daemon) exec --no-startup-id urxvtd @@ -136,7 +136,7 @@ exec --no-startup-id twmnd exec --no-startup-id nm-applet exec --no-startup-id volumeicon exec --no-startup-id feh --bg-center ~/.background.jpg -exec --no-startup-id gvim ~/note/index.wiki +exec --no-startup-id gvim -geometry 120x35 --servername VIMWIKI -c ":set title titlestring=VimWiki" ~/wiki/index.wiki exec --no-startup-id zeal exec --no-startup-id xautolock -time 5 -locker "i3lock -c 000000" exec --no-startup-id ~/.cabal/bin/arbtt-capture diff --git a/vim/.vimrc b/vim/.vimrc index 67ea86e..fba4a40 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -7,7 +7,8 @@ " * vim-unimpaired -- bracket mappings " * vim-gitgutter -- display git diffs alongside line numbers " * vim-renamer -- file renaming utility -" * vim-vimwiki -- makes it easier to manage e.g. notes +" * vim-pandoc -- `pandoc` integration +" * vim-pandoc-syntax -- `pandoc` syntax module " * goyo.vim -- undistracted writing mode " * vim-matlab-behave -- add basic matlab support @@ -54,14 +55,16 @@ nmap :e# autocmd InsertEnter * :setlocal nohlsearch autocmd InsertLeave * :setlocal hlsearch + " redraw wiki instance when managed via e.g. _i3wm scratch buffer_ autocmd FocusGained *.wiki :redraw! +autocmd BufRead,BufNewFile *.wiki set filetype=pandoc autocmd FileType scheme setlocal shiftwidth=2 tabstop=2 expandtab autocmd FileType lisp setlocal shiftwidth=2 tabstop=2 expandtab autocmd FileType racket setlocal shiftwidth=2 tabstop=2 expandtab -autocmd FileType vimwiki setlocal noswapfile nonumber foldcolumn=1 autoread -autocmd FileType vimwiki let g:airline#extensions#whitespace#checks=['indent', 'trailing', 'long'] +autocmd FileType pandoc setlocal nonumber autoread +autocmd FileType pandoc let g:airline#extensions#whitespace#checks=['indent', 'trailing', 'long'] vnoremap cc "+y nnoremap cc "+p @@ -102,13 +105,6 @@ let g:airline#extensions#tabline#show_splits = 0 let g:airline#extensions#tabline#show_tab_nr = 0 let g:airline#extensions#whitespace#mixed_indent_algo = 2 -let g:vimwiki_list = [{ - \ 'path': '~/note/', - \ 'path_html': '~/share/note/', - \ 'template_path': '~/share/note/assets/', - \ 'template_default': 'default', - \ 'template_ext': '.tpl' }] - let g:gitgutter_enabled = 0 let g:gitgutter_highlight_lines = 1 let g:goyo_width = 90 @@ -116,12 +112,11 @@ let g:goyo_margin_top = 1 let g:goyo_margin_bottom = 0 let g:matlab_behave_paste_cmd = "alt+v" +let g:pandoc#modules#disabled = ["folding","spell"] +let g:pandoc#syntax#conceal#blacklist = ["image","atx"] + nnoremap :NERDTreeToggle nnoremap :MundoToggle nnoremap :GitGutterToggle nnoremap :set cursorline! nnoremap :Goyo - -map t :VimwikiToggleListItem -nmap wtl VimwikiTableMoveColumnLeft -nmap wtr VimwikiTableMoveColumnRight -- cgit v1.2.3