multiple changes for nvim

- tex snippets were changed for listed and unlisted sections
- nvim autocompletion engine was swapped to nvim-cmp
- nvim clears more files when exiting tex files
- the compiler uses biber when compiling tex files
- sc-im is used for .sc filetypes when using vifm
master
tiyn 3 years ago
parent 745d1a6321
commit 7129be044e

@ -91,37 +91,37 @@ snippet ,sc "Small caps" A
endsnippet
snippet ,chap "Chapter" A
\chapter {$1}
\chapter{$1}
$2
endsnippet
snippet ,sec "Section" A
\section* {$1}
snippet ,usec "Section" A
\section{$1}
$2
endsnippet
snippet ,lsec "Section" A
\section {$1}
snippet ,sec "Section" A
\section{$1}
$2
endsnippet
snippet ,ssec "Subsection" A
\subsection* {$1}
\subsection{$1}
$2
endsnippet
snippet ,sssec "Subsubsection" A
\subsubsection* {$1}
\subsubsection{$1}
$2
endsnippet
snippet ,par "Paragraph" A
\paragraph* {$1}
\paragraph{$1}
$2
endsnippet
snippet ,spar "Subparagraph" A
\subparagraph* {$1}
\subparagraph{$1}
$2
endsnippet

@ -13,13 +13,14 @@ Plug 'airblade/vim-gitgutter' " git upgrades
Plug 'alvan/vim-closetag' " auto close HTML tags
Plug 'donRaphaco/neotex' , {'for': 'tex'} " asynchronous pdf rendering for pdf
Plug 'fatih/vim-go' , {'for': 'go'} " better support for golang
Plug 'hrsh7th/nvim-cmp' " autocompletion
Plug 'hrsh7th/cmp-nvim-lsp' " autocompletion bridge to lsp
Plug 'itchyny/lightline.vim' " fancy statusline
Plug 'junegunn/fzf.vim' " quickly jump files using fzf
Plug 'luochen1990/rainbow' " colorized matching brackets
Plug 'majutsushi/tagbar', {'on': 'TagbarToggle'} " show tags
Plug 'mattesgroeger/vim-bookmarks' " Set Bookmarks
Plug 'neovim/nvim-lspconfig' " Language server client
Plug 'nvim-lua/completion-nvim' " Automatically open the omni completion window while typing
Plug 'qpkorr/vim-renamer' " bulk renamer
Plug 'raimondi/delimitmate' " automatic closing of brackets
Plug 'rrethy/vim-hexokinase' , {'do': 'make hexokinase'} " color Preview
@ -108,6 +109,33 @@ highlight BookmarkLine ctermbg=194 ctermfg=NONE
let g:bookmark_sign = 'B'
let g:bookmark_highlight_lines = 1
" hrsh7th/nvim-cmp
lua << EOF
-- Add additional capabilities supported by nvim-cmp
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
-- Set completeopt to have a better completion experience
vim.o.completeopt = 'menuone,noselect'
-- nvim-cmp setup
local cmp = require 'cmp'
cmp.setup {
mapping = {
['<S-Tab>'] = cmp.mapping.select_prev_item(),
['<Tab>'] = cmp.mapping.select_next_item(),
['<C-e>'] = cmp.mapping.close(),
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}},
sources = {
{ name = 'nvim_lsp' },
},
}
EOF
" neovim/nvim-lspconfig
lua << EOF
local nvim_lsp = require('lspconfig')
@ -138,6 +166,7 @@ local servers = { "pyright", "bashls", "tsserver", "texlab", "ccls", "gopls", "h
for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup {
on_attach=on_attach,
capabilities=capabilities,
flags = {
debounce_text_changes = 150
}
@ -152,15 +181,7 @@ require'lspconfig'.jdtls.setup{
cmd = { 'jdtls' }
}
EOF
autocmd BufEnter * lua require'completion'.on_attach()
" nvim-lua/completion-nvim
let g:completion_matching_strategy_list = [ 'exact', 'substring', 'fuzzy' ]
let g:completion_matching_smart_case = 1
let g:completion_enable_snippet = 'UltiSnips'
" rrethy/vim-hexokinase
let g:Hexokinase_refreshEvents = ['InsertLeave']
@ -224,14 +245,6 @@ filetype plugin on
" enable syntax highlighting
syntax on
" enable specify completion options
set shortmess+=c
set completeopt=menuone,noinsert,noselect
inoremap <expr> <Tab> pumvisible() ? '<C-n>' : '<Tab>'
inoremap <expr> <S-Tab> pumvisible() ? '<C-p>' : '<S-Tab>'
inoremap <expr> <Down> pumvisible() ? '<C-n>' : '<Down>'
inoremap <expr> <Up> pumvisible() ? '<C-p>' : '<Up>'
" enable true colors
set termguicolors

@ -177,7 +177,7 @@ fileviewer *.pdf
"\ pdftotext -nopgbrk %c -
" CSV
filetype *.csv,*.xlsx sc-im %f
filetype *.csv,*.xlsx,*.sc sc-im %f
" PostScript
filextype *.ps,*.eps,*.ps.gz

@ -9,6 +9,7 @@
file=$(readlink -f "$1")
dir=$(dirname "$file")
base="${file%.*}"
basenodir="${1%.*}"
cd "$dir" || exit
@ -19,6 +20,7 @@ textype() { \
grep -i addbibresource "$file" >/dev/null &&
biber --input-directory "$dir" "$base" &&
$command --output-directory="$dir" "$base" &&
makeglossaries "$basenodir" &&
$command --output-directory="$dir" "$base"
}
@ -27,10 +29,10 @@ case "$file" in
*\.mom) refer -PS -e "$file" | groff -mom -kept -T pdf > "$base".pdf ;;
*\.[0-9]) refer -PS -e "$file" | groff -mandoc -T pdf > "$base".pdf ;;
*\.rmd) echo "require(rmarkdown); render('$file')" | R -q --vanilla ;;
*\.tex) textype "$file" ;;
*\.m) octave -qW "$file" ;;
*\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;;
*config.h) sudo make install ;;
*\.tex) textype "$file" ;;
*\.java) java "$file" ;;
*\.js) node "$file" ;;
*\.c) if [ -f Makefile ]; then make run; else cc "$file" -o "$base" && "$base"; fi ;;
@ -40,3 +42,4 @@ case "$file" in
*\.sent) setsid sent "$file" 2>/dev/null & ;;
*) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;;
esac

@ -10,7 +10,8 @@ case "$1" in
dir=$(dirname "$file")
base="${file%.*}"
if [ -f "$dir/indent.log" ]; then rm "$dir/indent.log"; fi
find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|log|synctex\\(busy\\)|lof|lot|maf|idx|mtc|mtc0|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl)" -delete ;;
find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyo|fls|vrb|fdb_latexmk|bak|swp|log|synctex\\(busy\\)|lof|lot|maf|idx|mtc|mtc0|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl|glg|glo|gls|glsdefs|ilg|ist|acn|acr|alg)" -delete ;
find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex ".*\\.aux" -delete ;;
*) printf "Give .tex file as argument.\\n" ;;
esac

Loading…
Cancel
Save