mirror of
https://github.com/tiyn/dotfiles.git
synced 2025-04-19 08:17:47 +02:00
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
This commit is contained in:
parent
745d1a6321
commit
7129be044e
@ -91,37 +91,37 @@ snippet ,sc "Small caps" A
|
|||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet ,chap "Chapter" A
|
snippet ,chap "Chapter" A
|
||||||
\chapter {$1}
|
\chapter{$1}
|
||||||
|
$2
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet ,usec "Section" A
|
||||||
|
\section{$1}
|
||||||
$2
|
$2
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet ,sec "Section" A
|
snippet ,sec "Section" A
|
||||||
\section* {$1}
|
\section{$1}
|
||||||
$2
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet ,lsec "Section" A
|
|
||||||
\section {$1}
|
|
||||||
$2
|
$2
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet ,ssec "Subsection" A
|
snippet ,ssec "Subsection" A
|
||||||
\subsection* {$1}
|
\subsection{$1}
|
||||||
$2
|
$2
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet ,sssec "Subsubsection" A
|
snippet ,sssec "Subsubsection" A
|
||||||
\subsubsection* {$1}
|
\subsubsection{$1}
|
||||||
$2
|
$2
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet ,par "Paragraph" A
|
snippet ,par "Paragraph" A
|
||||||
\paragraph* {$1}
|
\paragraph{$1}
|
||||||
$2
|
$2
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet ,spar "Subparagraph" A
|
snippet ,spar "Subparagraph" A
|
||||||
\subparagraph* {$1}
|
\subparagraph{$1}
|
||||||
$2
|
$2
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
@ -13,13 +13,14 @@ Plug 'airblade/vim-gitgutter' " git upgrades
|
|||||||
Plug 'alvan/vim-closetag' " auto close HTML tags
|
Plug 'alvan/vim-closetag' " auto close HTML tags
|
||||||
Plug 'donRaphaco/neotex' , {'for': 'tex'} " asynchronous pdf rendering for pdf
|
Plug 'donRaphaco/neotex' , {'for': 'tex'} " asynchronous pdf rendering for pdf
|
||||||
Plug 'fatih/vim-go' , {'for': 'go'} " better support for golang
|
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 'itchyny/lightline.vim' " fancy statusline
|
||||||
Plug 'junegunn/fzf.vim' " quickly jump files using fzf
|
Plug 'junegunn/fzf.vim' " quickly jump files using fzf
|
||||||
Plug 'luochen1990/rainbow' " colorized matching brackets
|
Plug 'luochen1990/rainbow' " colorized matching brackets
|
||||||
Plug 'majutsushi/tagbar', {'on': 'TagbarToggle'} " show tags
|
Plug 'majutsushi/tagbar', {'on': 'TagbarToggle'} " show tags
|
||||||
Plug 'mattesgroeger/vim-bookmarks' " Set Bookmarks
|
Plug 'mattesgroeger/vim-bookmarks' " Set Bookmarks
|
||||||
Plug 'neovim/nvim-lspconfig' " Language server client
|
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 'qpkorr/vim-renamer' " bulk renamer
|
||||||
Plug 'raimondi/delimitmate' " automatic closing of brackets
|
Plug 'raimondi/delimitmate' " automatic closing of brackets
|
||||||
Plug 'rrethy/vim-hexokinase' , {'do': 'make hexokinase'} " color Preview
|
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_sign = 'B'
|
||||||
let g:bookmark_highlight_lines = 1
|
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
|
" neovim/nvim-lspconfig
|
||||||
lua << EOF
|
lua << EOF
|
||||||
local nvim_lsp = require('lspconfig')
|
local nvim_lsp = require('lspconfig')
|
||||||
@ -138,6 +166,7 @@ local servers = { "pyright", "bashls", "tsserver", "texlab", "ccls", "gopls", "h
|
|||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do
|
||||||
nvim_lsp[lsp].setup {
|
nvim_lsp[lsp].setup {
|
||||||
on_attach=on_attach,
|
on_attach=on_attach,
|
||||||
|
capabilities=capabilities,
|
||||||
flags = {
|
flags = {
|
||||||
debounce_text_changes = 150
|
debounce_text_changes = 150
|
||||||
}
|
}
|
||||||
@ -152,15 +181,7 @@ require'lspconfig'.jdtls.setup{
|
|||||||
cmd = { 'jdtls' }
|
cmd = { 'jdtls' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
EOF
|
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
|
" rrethy/vim-hexokinase
|
||||||
let g:Hexokinase_refreshEvents = ['InsertLeave']
|
let g:Hexokinase_refreshEvents = ['InsertLeave']
|
||||||
@ -224,14 +245,6 @@ filetype plugin on
|
|||||||
" enable syntax highlighting
|
" enable syntax highlighting
|
||||||
syntax on
|
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
|
" enable true colors
|
||||||
set termguicolors
|
set termguicolors
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ fileviewer *.pdf
|
|||||||
"\ pdftotext -nopgbrk %c -
|
"\ pdftotext -nopgbrk %c -
|
||||||
|
|
||||||
" CSV
|
" CSV
|
||||||
filetype *.csv,*.xlsx sc-im %f
|
filetype *.csv,*.xlsx,*.sc sc-im %f
|
||||||
|
|
||||||
" PostScript
|
" PostScript
|
||||||
filextype *.ps,*.eps,*.ps.gz
|
filextype *.ps,*.eps,*.ps.gz
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
file=$(readlink -f "$1")
|
file=$(readlink -f "$1")
|
||||||
dir=$(dirname "$file")
|
dir=$(dirname "$file")
|
||||||
base="${file%.*}"
|
base="${file%.*}"
|
||||||
|
basenodir="${1%.*}"
|
||||||
|
|
||||||
cd "$dir" || exit
|
cd "$dir" || exit
|
||||||
|
|
||||||
@ -19,6 +20,7 @@ textype() { \
|
|||||||
grep -i addbibresource "$file" >/dev/null &&
|
grep -i addbibresource "$file" >/dev/null &&
|
||||||
biber --input-directory "$dir" "$base" &&
|
biber --input-directory "$dir" "$base" &&
|
||||||
$command --output-directory="$dir" "$base" &&
|
$command --output-directory="$dir" "$base" &&
|
||||||
|
makeglossaries "$basenodir" &&
|
||||||
$command --output-directory="$dir" "$base"
|
$command --output-directory="$dir" "$base"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,10 +29,10 @@ case "$file" in
|
|||||||
*\.mom) refer -PS -e "$file" | groff -mom -kept -T pdf > "$base".pdf ;;
|
*\.mom) refer -PS -e "$file" | groff -mom -kept -T pdf > "$base".pdf ;;
|
||||||
*\.[0-9]) refer -PS -e "$file" | groff -mandoc -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 ;;
|
*\.rmd) echo "require(rmarkdown); render('$file')" | R -q --vanilla ;;
|
||||||
*\.tex) textype "$file" ;;
|
|
||||||
*\.m) octave -qW "$file" ;;
|
*\.m) octave -qW "$file" ;;
|
||||||
*\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;;
|
*\.md) pandoc "$file" --pdf-engine=xelatex -o "$base".pdf ;;
|
||||||
*config.h) sudo make install ;;
|
*config.h) sudo make install ;;
|
||||||
|
*\.tex) textype "$file" ;;
|
||||||
*\.java) java "$file" ;;
|
*\.java) java "$file" ;;
|
||||||
*\.js) node "$file" ;;
|
*\.js) node "$file" ;;
|
||||||
*\.c) if [ -f Makefile ]; then make run; else cc "$file" -o "$base" && "$base"; fi ;;
|
*\.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 & ;;
|
*\.sent) setsid sent "$file" 2>/dev/null & ;;
|
||||||
*) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;;
|
*) sed 1q "$file" | grep "^#!/" | sed "s/^#!//" | xargs -r -I % "$file" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -10,7 +10,8 @@ case "$1" in
|
|||||||
dir=$(dirname "$file")
|
dir=$(dirname "$file")
|
||||||
base="${file%.*}"
|
base="${file%.*}"
|
||||||
if [ -f "$dir/indent.log" ]; then rm "$dir/indent.log"; fi
|
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" ;;
|
*) printf "Give .tex file as argument.\\n" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user