diff --git a/init.lua b/init.lua index e6f8d04..42921ef 100644 --- a/init.lua +++ b/init.lua @@ -162,7 +162,7 @@ map('v', '>', '>gv') -- fzf nmap('ff', ':Files') nmap('ft', ':Files ~/Tmp') -nmap('fo', ":call fzf#run(fzf#wrap(fzf#vim#with_preview({ 'source': 'fd . --type f --extension=md --follow --exclude .git ~/ownCloud/Obsidian/Personal' })))", { silent = true }) +nmap('fo', ":call fzf#run(fzf#wrap(fzf#vim#with_preview({ 'source': 'fd . --type f --extension=md --follow --exclude .git ~/Syncthing/Obsidian/Personal' })))", { silent = true }) -- vim-easy-align map('x', 'ga', ':EasyAlign') -- TODO: this should allow for gaip, but does not diff --git a/vim/.vimrc b/vim/.vimrc index 592bf8d..e486e44 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -7,7 +7,6 @@ " -> General " ======================================================== -set fileencoding=utf-8 nnoremap let mapleader=' ' @@ -168,9 +167,10 @@ if has('nvim') || has('gui_running') let $FZF_DEFAULT_OPTS .= ' --no-info --color=gutter:#2E3440' endif -command! -nargs=? -complete=dir AF +" Obsidian +command! FO \ call fzf#run(fzf#wrap(fzf#vim#with_preview({ - \ 'source': 'fd --type f --hidden --follow --exclude .git --no-ignore . '.expand() + \ 'source': 'fd . --type f --extension=md --follow --exclude .git ~/Syncthing/Obsidian/Personal' \ }))) let g:fzf_preview_window = '' @@ -415,6 +415,7 @@ nnoremap ga :Gwrite nnoremap gs :Git nnoremap gb :Git blame +nnoremap t :tabnew nnoremap :tabnext nnoremap :tabprevious @@ -456,16 +457,11 @@ xmap ga (EasyAlign) nmap ga (EasyAlign) -nnoremap e (expand('%') =~ 'NERD_tree' ? "\\" : '').":Files ~/Tmp\" -nnoremap E :e ~/Tmp/ +nnoremap ft (expand('%') =~ 'NERD_tree' ? "\\" : '').":Files ~/Tmp\" +nnoremap T :e ~/Tmp/ -" TODO Ignore .obsidian/ -nnoremap o (expand('%') =~ 'NERD_tree' ? "\\" : '').":Files ~/Library/Mobile\ Documents/iCloud~md~obsidian/Documents/Personal\" -nnoremap O :e ~/Library/Mobile\ Documents/iCloud~md~obsidian/Documents/Personal - -" EXPERIMENTAL STUFF -nnoremap ft Telescope find_files -" nmap ft Telescope live_grep +nnoremap fo (expand('%') =~ 'NERD_tree' ? "\\" : '').":FO" +nnoremap O :e ~/ownCloud/Obsidian/Personal " undo break points inoremap , ,u @@ -473,8 +469,7 @@ inoremap . .u inoremap ! !u inoremap ? ?u -" Fix gx -" https://github.com/vim/vim/issues/4738#issuecomment-856925080 +" Fix gx https://github.com/vim/vim/issues/4738#issuecomment-856925080 nnoremap gx :execute 'silent! !open ' . shellescape(expand(''), 1) lua <