fzf in vim & groff utils
This commit is contained in:
parent
dc5dfd8467
commit
e0a98fd1da
6 changed files with 44 additions and 19 deletions
|
@ -12,6 +12,7 @@ define . '~ \[md] ~'
|
||||||
define * '~ \[mu] ~'
|
define * '~ \[mu] ~'
|
||||||
define +- '~ \[+-] ~'
|
define +- '~ \[+-] ~'
|
||||||
define -+ '~ + bar ~'
|
define -+ '~ + bar ~'
|
||||||
|
define tf '~ \[tf] ~'
|
||||||
define and '~ \[AN] ~'
|
define and '~ \[AN] ~'
|
||||||
define div '~ \[di] ~'
|
define div '~ \[di] ~'
|
||||||
|
|
||||||
|
|
5
groff/utils
Normal file
5
groff/utils
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
\" Print a rule as long as specified
|
||||||
|
\" in the first argument
|
||||||
|
.de rule
|
||||||
|
\D'l \\$1 0'
|
||||||
|
..
|
|
@ -12,7 +12,7 @@
|
||||||
# Configuration
|
# Configuration
|
||||||
BIB="$HOME/Desktop/bibliography" # Bibliography file
|
BIB="$HOME/Desktop/bibliography" # Bibliography file
|
||||||
MAC="$HOME/.config/groff/" # Macros dir
|
MAC="$HOME/.config/groff/" # Macros dir
|
||||||
PRE="ketp" # Preprocessors
|
PRE="ketp" # Preprocessors
|
||||||
|
|
||||||
# Enable macros, grab references, include args
|
# Enable macros, grab references, include args
|
||||||
soelim -I "$MAC" "$1" | refer -p "$BIB" |
|
soelim -I "$MAC" "$1" | refer -p "$BIB" |
|
||||||
|
|
|
@ -70,7 +70,7 @@ silent! normal! zE
|
||||||
231,232fold
|
231,232fold
|
||||||
201,232fold
|
201,232fold
|
||||||
239,240fold
|
239,240fold
|
||||||
247,261fold
|
247,269fold
|
||||||
let &fdl = &fdl
|
let &fdl = &fdl
|
||||||
25
|
25
|
||||||
normal! zo
|
normal! zo
|
||||||
|
@ -92,14 +92,13 @@ normal! zc
|
||||||
normal! zo
|
normal! zo
|
||||||
201
|
201
|
||||||
normal! zc
|
normal! zc
|
||||||
let s:l = 21 - ((20 * winheight(0) + 17) / 35)
|
let s:l = 265 - ((31 * winheight(0) + 17) / 35)
|
||||||
if s:l < 1 | let s:l = 1 | endif
|
if s:l < 1 | let s:l = 1 | endif
|
||||||
keepjumps exe s:l
|
keepjumps exe s:l
|
||||||
normal! zt
|
normal! zt
|
||||||
keepjumps 21
|
keepjumps 265
|
||||||
normal! 0
|
normal! 01|
|
||||||
let &g:so = s:so_save | let &g:siso = s:siso_save
|
let &g:so = s:so_save | let &g:siso = s:siso_save
|
||||||
set hlsearch
|
set hlsearch
|
||||||
nohlsearch
|
|
||||||
doautoall SessionLoadPost
|
doautoall SessionLoadPost
|
||||||
" vim: set ft=vim :
|
" vim: set ft=vim :
|
||||||
|
|
46
vim/vimrc
46
vim/vimrc
|
@ -9,6 +9,7 @@ set ignorecase
|
||||||
set smartcase
|
set smartcase
|
||||||
set expandtab
|
set expandtab
|
||||||
set tabstop=4
|
set tabstop=4
|
||||||
|
set autoread
|
||||||
set wildmenu
|
set wildmenu
|
||||||
set hlsearch
|
set hlsearch
|
||||||
set swapfile
|
set swapfile
|
||||||
|
@ -19,26 +20,37 @@ set number
|
||||||
|
|
||||||
" notes
|
" notes
|
||||||
autocmd BufWritePost note-*.md execute '! git -C ~/Documents/notes/ add ~/Documents/notes/% ; git commit -m "Auto-commit: saved %"'
|
autocmd BufWritePost note-*.md execute '! git -C ~/Documents/notes/ add ~/Documents/notes/% ; git commit -m "Auto-commit: saved %"'
|
||||||
|
|
||||||
" groff
|
" groff
|
||||||
|
autocmd FileType groff noremap <buffer> <silent> <F9> :!zathura --fork %:r.pdf<CR> & disown
|
||||||
autocmd FileType groff noremap <buffer> <C-s> :w<CR> :!groff-compiler % > %:r.pdf<CR><CR>
|
autocmd FileType groff noremap <buffer> <C-s> :w<CR> :!groff-compiler % > %:r.pdf<CR><CR>
|
||||||
autocmd FileType groff noremap <buffer> <F9> :w<CR> :!groff-compiler % > %:r.pdf<CR><CR> :![ "$(pidof -x 'zathura')" = "" ] && zathura --fork %:r.pdf<CR> && disown
|
|
||||||
au BufNewFile,BufRead *.ms set filetype=groff
|
au BufNewFile,BufRead *.ms set filetype=groff
|
||||||
|
|
||||||
" LaTeX
|
" LaTeX
|
||||||
autocmd FileType tex noremap <buffer> <C-c> :w<CR> :!latex %<CR> :!pdflatex %<CR>
|
autocmd FileType tex noremap <buffer> <F9> :w<CR> :!latex %<CR> :!pdflatex %<CR>
|
||||||
autocmd FileType bib noremap <buffer> <C-c> :w<CR> :!bibtex %<CR>
|
autocmd FileType bib noremap <buffer> <F9> :w<CR> :!bibtex %<CR>
|
||||||
|
|
||||||
" Python
|
" Python
|
||||||
autocmd FileType python noremap <buffer> <F9> :w<CR> :!python %<CR>
|
autocmd FileType python noremap <buffer> <F9> :w<CR> :!python %<CR>
|
||||||
|
|
||||||
" NERDTree
|
" NERDTree
|
||||||
nnoremap <C-t> :NERDTreeToggle<CR>
|
nnoremap <C-t> :NERDTreeToggle<CR>
|
||||||
|
|
||||||
" Global keybindings
|
" Global keybindings
|
||||||
noremap <F5> :setlocal spell! spelllang=en<CR>
|
noremap <F5> :setlocal spell! spelllang=en<CR>
|
||||||
noremap <F6> :setlocal spell! spelllang=es<CR>
|
noremap <F6> :setlocal spell! spelllang=es<CR>
|
||||||
noremap exec !!$SHELL<CR>
|
noremap exec !!$SHELL<CR>
|
||||||
noremap <C-n> /@@@<CR>
|
noremap <C-n> :bn<CR>
|
||||||
noremap <tab> :bn<CR>
|
|
||||||
noremap <C-c> :bd<CR>
|
noremap <C-c> :bd<CR>
|
||||||
noremap <C-s> :w<CR>
|
noremap <C-s> :w<CR>
|
||||||
noremap <Space> za
|
noremap <Space> za
|
||||||
|
noremap N /@@@<CR>
|
||||||
|
|
||||||
|
" Folds
|
||||||
|
autocmd BufWinLeave bibliography zM | mkview
|
||||||
|
autocmd BufWinEnter bibliography silent loadview
|
||||||
|
autocmd BufWinLeave bookmarks zM | mkview
|
||||||
|
autocmd BufWinEnter bookmarks silent loadview
|
||||||
|
|
||||||
" Enabling .config
|
" Enabling .config
|
||||||
let rtp=&runtimepath
|
let rtp=&runtimepath
|
||||||
|
@ -59,11 +71,13 @@ if empty(glob('~/.config/vim/autoload/plug.vim'))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call plug#begin()
|
call plug#begin()
|
||||||
Plug 'https://github.com/vim-airline/vim-airline-themes'
|
Plug 'vim-airline/vim-airline-themes'
|
||||||
Plug 'https://github.com/vim-airline/vim-airline'
|
Plug 'vim-airline/vim-airline'
|
||||||
Plug 'https://github.com/preservim/nerdtree'
|
Plug 'Yggdroot/indentLine'
|
||||||
Plug 'https://github.com/morhetz/gruvbox'
|
Plug 'preservim/nerdtree'
|
||||||
Plug 'junegunn/goyo.vim'
|
Plug 'junegunn/goyo.vim'
|
||||||
|
Plug 'ibhagwan/fzf-lua' " Neovim exclusive
|
||||||
|
Plug 'morhetz/gruvbox'
|
||||||
"Plug 'dracula/vim'
|
"Plug 'dracula/vim'
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
|
@ -84,7 +98,13 @@ set noshowmode
|
||||||
map gy :Goyo<CR>
|
map gy :Goyo<CR>
|
||||||
autocmd! User GoyoLeave highlight Normal ctermbg=NONE
|
autocmd! User GoyoLeave highlight Normal ctermbg=NONE
|
||||||
|
|
||||||
autocmd BufWinLeave bibliography zM | mkview
|
" IndentLine
|
||||||
autocmd BufWinEnter bibliography silent loadview
|
let g:indentLine_enabled = 1
|
||||||
autocmd BufWinLeave bookmarks zM | mkview
|
let g:indentLine_char = '|'
|
||||||
autocmd BufWinEnter bookmarks silent loadview
|
|
||||||
|
" fzf-lua
|
||||||
|
noremap <tab> :FzfLua complete_line<CR>
|
||||||
|
noremap <A-b> :FzfLua git_branches<CR>
|
||||||
|
noremap <A-c> :FzfLua git_commits<CR>
|
||||||
|
noremap <A-s> :FzfLua git_status<CR>
|
||||||
|
noremap <A-f> :FzfLua files<CR>
|
||||||
|
|
Loading…
Reference in a new issue