blob: ecfd17eaa9599eb4e4bfb24eb0e80fa80fe165a1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
syntax enable
filetype plugin indent on
set tabstop=4
set shiftwidth=4
set expandtab
set noesckeys
set relativenumber
set number
set ignorecase
set smartcase
set incsearch
set modeline
set nohlsearch
autocmd FileType org,outline setlocal nofoldenable
call plug#begin()
Plug 'junegunn/goyo.vim'
Plug 'junegunn/fzf.vim'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-surround'
Plug 'ap/vim-css-color'
Plug 'zah/nim.vim'
call plug#end()
vmap <C-c> "+yi
vmap <C-x> "+c
vmap <C-v> c<ESC>"+p
imap <C-v> <ESC>"+pa
function! BardFindNotesFile()
let l:cmd = "find ~/Notes/denote -type f -name '*.org' " .
\ "! -path '*/.git/*' ! -path '*/.cache/*' | " .
\ "grep -E './[0-9]{8}T[0-9]{6}--.*\\.org$'"
call fzf#run(fzf#wrap({
\ 'source': l:cmd,
\ 'sink': 'e',
\ 'options': '--prompt "Notes> " --preview "cat {}"'
\ }))
endfunction
command! FindNotesFile call BardFindNotesFile()
function! BardSearchNotes()
call fzf#vim#grep(
\ "rg --column --line-number --no-heading --color=always " .
\ "--hidden --glob '!**/.git/*' --glob '!**/.cache/*' " .
\ "' ' ~/Notes/denote", 1,
\ fzf#vim#with_preview(), 0)
endfunction
command! SearchNotes call BardSearchNotes()
" KEYBINDS
let mapleader = " "
nnoremap <Leader>fn :FindNotesFile<CR>
nnoremap <Leader>sn :SearchNotes<CR>
nnoremap <Leader>ff :Files<CR>
nnoremap <Leader>b :Marks<CR>
|