nvim
This commit is contained in:
commit
b9d02eca4c
190
.config/nvim/UltiSnips/tex.snippets
Normal file
190
.config/nvim/UltiSnips/tex.snippets
Normal file
|
@ -0,0 +1,190 @@
|
|||
snippet mk "Math" wA
|
||||
$${1}$`!p
|
||||
if t[2] and t[2][0] not in [',', '.', '?', '-', ' ']:
|
||||
snip.rv = ' '
|
||||
else:
|
||||
snip.rv = ''
|
||||
`$2
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet dm "Math" wA
|
||||
\[
|
||||
$1
|
||||
.\] $0
|
||||
endsnippet
|
||||
|
||||
snippet beg "begin{} / end{}" bA
|
||||
\begin{$1}
|
||||
$0
|
||||
\end{$1}
|
||||
endsnippet
|
||||
|
||||
snippet '([A-Za-z])(\d)' "auto subscript" wrA
|
||||
`!p snip.rv = match.group(1)`_`!p snip.rv = match.group(2)`
|
||||
endsnippet
|
||||
|
||||
snippet '([A-Za-z])_(\d\d)' "auto subscript2" wrA
|
||||
`!p snip.rv = match.group(1)`_{`!p snip.rv = match.group(2)`}
|
||||
endsnippet
|
||||
|
||||
snippet td "superscript" iA
|
||||
^{$1}$0
|
||||
endsnippet
|
||||
|
||||
snippet // "Fraction" iA
|
||||
\\cfrac{$1}{$2}$0
|
||||
endsnippet
|
||||
|
||||
snippet "(\\?\w+)(,\.|\.,)" "Vector postfix" riA
|
||||
\vec{`!p snip.rv=match.group(1)`}
|
||||
endsnippet
|
||||
|
||||
snippet sumlim "sumlimits" iA
|
||||
\\sum\\limits_{$1}^{$2} $0
|
||||
endsnippet
|
||||
|
||||
snippet intlim "intlimits" iA
|
||||
\\bigintss\\limits_{$1}^{$2} $0
|
||||
endsnippet
|
||||
|
||||
snippet limlim "limlimits" iA
|
||||
\\lim\\limits_{$1} $0
|
||||
endsnippet
|
||||
|
||||
snippet RR "RR" i
|
||||
\\mathbb{R}
|
||||
endsnippet
|
||||
|
||||
snippet NN "NN" i
|
||||
\\mathbb{N}
|
||||
endsnippet
|
||||
|
||||
snippet ZZ "ZZ" i
|
||||
\\mathbb{Z}
|
||||
endsnippet
|
||||
|
||||
snippet RR_ "RR" i
|
||||
\\overline{\\mathbb{R}}
|
||||
endsnippet
|
||||
|
||||
snippet <= "leqslant" i
|
||||
\\leqslant
|
||||
endsnippet
|
||||
|
||||
snippet >= "geqslant" i
|
||||
\\geqslant
|
||||
endsnippet
|
||||
|
||||
snippet => "Rightarrow" i
|
||||
\\Rightarrow
|
||||
endsnippet
|
||||
|
||||
snippet <=> "Rightarrow" i
|
||||
\\Leftrightarrow
|
||||
endsnippet
|
||||
|
||||
snippet Er "exists" i
|
||||
\\exists
|
||||
endsnippet
|
||||
|
||||
snippet Ar "forall" i
|
||||
\\forall
|
||||
endsnippet
|
||||
|
||||
snippet eps "eps" i
|
||||
\\varepsilon
|
||||
endsnippet
|
||||
|
||||
snippet phi "phi" i
|
||||
\\varphi
|
||||
endsnippet
|
||||
|
||||
snippet диф "диф" i
|
||||
диффиринцир
|
||||
endsnippet
|
||||
|
||||
snippet коэф "коэф" i
|
||||
коэффициент
|
||||
endsnippet
|
||||
|
||||
snippet int "int" i
|
||||
\\bigintss
|
||||
endsnippet
|
||||
|
||||
snippet bf "textbf" i
|
||||
\\textbf{$1} $0
|
||||
endsnippet
|
||||
|
||||
snippet иа "textbf" i
|
||||
\\textbf{$1} $0
|
||||
endsnippet
|
||||
|
||||
snippet inf "infty" iA
|
||||
\\infty
|
||||
endsnippet
|
||||
|
||||
snippet op "operator" i
|
||||
\\operatorname{$1} $0
|
||||
endsnippet
|
||||
|
||||
snippet * "*" i
|
||||
\\cdot
|
||||
endsnippet
|
||||
|
||||
snippet ii "ii" i
|
||||
($1]
|
||||
endsnippet
|
||||
|
||||
snippet la "la" i
|
||||
\\lambda
|
||||
endsnippet
|
||||
|
||||
snippet del "delta" i
|
||||
\\delta
|
||||
endsnippet
|
||||
|
||||
|
||||
snippet header "header" i
|
||||
\documentclass[a4paper, 12pt]{article}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\pagestyle{empty}
|
||||
\usepackage[usenames]{color} %used for font color
|
||||
\usepackage[russian]{babel}
|
||||
\usepackage{amssymb} %maths
|
||||
\usepackage{amsmath} %maths
|
||||
\usepackage{wrapfig}
|
||||
\usepackage{xcolor}
|
||||
|
||||
\usepackage{chapterbib}
|
||||
|
||||
\usepackage{natbib}
|
||||
\usepackage{graphicx}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{bigints}
|
||||
|
||||
\usepackage[normalem]{ulem} % для зачекивания текста
|
||||
|
||||
\definecolor{linkcolor}{HTML}{0000FF} % цвет ссылок
|
||||
\definecolor{urlcolor}{HTML}{0000FF} % цвет гиперссылок
|
||||
\hypersetup{pdfstartview=FitH, linkcolor=linkcolor,urlcolor=urlcolor, colorlinks=true}
|
||||
|
||||
\oddsidemargin = 0 pt
|
||||
\textwidth = 18 cm
|
||||
\marginparsep = 0 pt
|
||||
\marginparwidth = 0 pt
|
||||
\hoffset = -0.41 in
|
||||
|
||||
\headheight = 0 pt
|
||||
\headsep = 0 pt
|
||||
\topmargin = 0 pt
|
||||
\voffset = -0.4 in
|
||||
\textheight = 10.511 in
|
||||
|
||||
\graphicspath{{pictures/}}
|
||||
\DeclareGraphicsExtensions{.pdf,.png,.jpg}
|
||||
|
||||
\begin{document}
|
||||
$1
|
||||
\end{document}
|
||||
endsnippet
|
97
.config/nvim/indent/cpp.vim
Normal file
97
.config/nvim/indent/cpp.vim
Normal file
|
@ -0,0 +1,97 @@
|
|||
" Vim indent file
|
||||
" Language: C++
|
||||
" Maintainer: Konstantin Lepa <konstantin.lepa@gmail.com>
|
||||
" Last Change: 2010 May 20
|
||||
" License: MIT
|
||||
" Version: 1.1.0
|
||||
"
|
||||
" Changes {{{
|
||||
" 1.1.0 2011-01-17
|
||||
" Refactored source code.
|
||||
" Some fixes.
|
||||
"
|
||||
" 1.0.1 2010-05-20
|
||||
" Added some changes. Thanks to Eric Rannaud <eric.rannaud@gmail.com>
|
||||
"
|
||||
"}}}
|
||||
|
||||
setlocal cindent
|
||||
" handle lambda correctly
|
||||
setlocal cino=j1,(0,ws,Ws
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
|
||||
function! GoogleCppIndent()
|
||||
let l:cline_num = line('.')
|
||||
|
||||
let l:orig_indent = cindent(l:cline_num)
|
||||
|
||||
if l:orig_indent == 0 | return 0 | endif
|
||||
|
||||
let l:pline_num = prevnonblank(l:cline_num - 1)
|
||||
let l:pline = getline(l:pline_num)
|
||||
if l:pline =~# '^\s*template' | return l:pline_indent | endif
|
||||
|
||||
" TODO: I don't know to correct it:
|
||||
" namespace test {
|
||||
" void
|
||||
" ....<-- invalid cindent pos
|
||||
"
|
||||
" void test() {
|
||||
" }
|
||||
"
|
||||
" void
|
||||
" <-- cindent pos
|
||||
if l:orig_indent != &shiftwidth | return l:orig_indent | endif
|
||||
|
||||
let l:in_comment = 0
|
||||
let l:pline_num = prevnonblank(l:cline_num - 1)
|
||||
while l:pline_num > -1
|
||||
let l:pline = getline(l:pline_num)
|
||||
let l:pline_indent = indent(l:pline_num)
|
||||
|
||||
if l:in_comment == 0 && l:pline =~ '^.\{-}\(/\*.\{-}\)\@<!\*/'
|
||||
let l:in_comment = 1
|
||||
elseif l:in_comment == 1
|
||||
if l:pline =~ '/\*\(.\{-}\*/\)\@!'
|
||||
let l:in_comment = 0
|
||||
endif
|
||||
elseif l:pline_indent == 0
|
||||
if l:pline !~# '\(#define\)\|\(^\s*//\)\|\(^\s*{\)'
|
||||
if l:pline =~# '^\s*namespace.*'
|
||||
return 0
|
||||
else
|
||||
return l:orig_indent
|
||||
endif
|
||||
elseif l:pline =~# '\\$'
|
||||
return l:orig_indent
|
||||
endif
|
||||
else
|
||||
return l:orig_indent
|
||||
endif
|
||||
|
||||
let l:pline_num = prevnonblank(l:pline_num - 1)
|
||||
endwhile
|
||||
|
||||
return l:orig_indent
|
||||
endfunction
|
||||
|
||||
setlocal shiftwidth=2
|
||||
setlocal tabstop=2
|
||||
setlocal softtabstop=2
|
||||
setlocal expandtab
|
||||
setlocal textwidth=80
|
||||
setlocal wrap
|
||||
|
||||
setlocal cindent
|
||||
setlocal cinoptions=h1,l1,g1,t0,i4,+4,(0,w1,W4
|
||||
|
||||
setlocal indentexpr=GoogleCppIndent()
|
||||
|
||||
let b:undo_indent = "setl sw< ts< sts< et< tw< wrap< cin< cino< inde<"
|
||||
|
||||
" set foldmethod=syntax
|
168
.config/nvim/init.vim
Normal file
168
.config/nvim/init.vim
Normal file
|
@ -0,0 +1,168 @@
|
|||
set rtp+=~/.config/nvim/plugged/Vundle.vim
|
||||
|
||||
call plug#begin('~/.config/nvim/plugged')
|
||||
Plug 'VundleVim/Vundle.vim'
|
||||
Plug 'ycm-core/YouCompleteMe', {'for': ['cpp', 'hpp', 'c', 'h']}
|
||||
Plug 'lervag/vimtex', {'for': 'tex'}
|
||||
Plug 'honza/vim-snippets'
|
||||
Plug 'sirver/ultisnips', {'for': 'tex'}
|
||||
Plug 'xuhdev/vim-latex-live-preview', {'for': 'tex'}
|
||||
Plug 'morhetz/gruvbox'
|
||||
Plug 'jiangmiao/auto-pairs'
|
||||
Plug 'joom/vim-commentary'
|
||||
Plug 'vimplugin/project.vim'
|
||||
Plug 'mattn/emmet-vim', { 'for': 'html' }
|
||||
Plug 'christoomey/vim-tmux-navigator'
|
||||
" Plug 'rhysd/vim-clang-format'
|
||||
Plug 'tpope/vim-surround'
|
||||
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
|
||||
|
||||
Plug 'qpkorr/vim-bufkill'
|
||||
|
||||
Plug 'vim-airline/vim-airline'
|
||||
Plug 'vim-airline/vim-airline-themes'
|
||||
|
||||
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
|
||||
" Plug 'kyazdani42/nvim-tree.lua'
|
||||
" Plug 'kyazdani42/nvim-web-devicons' " optional, for file icons
|
||||
call plug#end()
|
||||
|
||||
let g:ycm_filetype_blacklist = {
|
||||
\ 'tex': 1,
|
||||
\}
|
||||
|
||||
let g:ycm_auto_trigger=0
|
||||
set completeopt-=preview
|
||||
|
||||
" set spell spelllang=ru
|
||||
|
||||
set nocompatible " be iMproved, required
|
||||
filetype off " required
|
||||
|
||||
set tabstop=2
|
||||
set softtabstop=2
|
||||
set shiftwidth=2
|
||||
set expandtab
|
||||
|
||||
set number
|
||||
" source ~/.config/nvim/plugged/restore_view.vim
|
||||
" source ~/.config/nvim/plugged/google.vim
|
||||
set foldmethod=syntax
|
||||
|
||||
map <C-n> :NERDTreeToggle<CR>
|
||||
" set viewoptions=cursor,folds,slash,unix
|
||||
|
||||
filetype on
|
||||
" filetype plugin indent on
|
||||
|
||||
let g:tex_flavor='latex'
|
||||
let g:vimtex_view_method='zathura'
|
||||
let g:vimtex_quickfix_mode=0
|
||||
set conceallevel=1
|
||||
let g:tex_conceal='abdmg'
|
||||
|
||||
let g:UltiSnipsSnippetDirectories = ['~/.config/nvim/UltiSnips', 'UltiSnips']
|
||||
let g:UltiSnipsExpandTrigger = '<tab>'
|
||||
let g:UltiSnipsJumpForwardTrigger = '<tab>'
|
||||
let g:UltiSnipsJumpBackwardTrigger = '<s-tab>'
|
||||
|
||||
let g:livepreview_previewer = 'zathura'
|
||||
let g:livepreview_use_biber = 1
|
||||
let g:livepreview_cursorhold_recompile = 1
|
||||
|
||||
nnoremap <C-J> <C-W><C-J>
|
||||
nnoremap <C-K> <C-W><C-K>
|
||||
nnoremap <C-L> <C-W><C-L>
|
||||
nnoremap <C-H> <C-W><C-H>
|
||||
|
||||
au FocusGained,BufEnter * :checktime
|
||||
au CursorHold,CursorHoldI * checktime
|
||||
au CursorHold * checktime
|
||||
set autoread
|
||||
" nnoremap <F8> :!make <CR>
|
||||
" nnoremap <F9> :!./a <input.txt >output.txt <CR>
|
||||
|
||||
set colorcolumn=100
|
||||
|
||||
let g:gruvbox_contrast_dark = 'soft'
|
||||
|
||||
colorscheme gruvbox
|
||||
set background=dark
|
||||
|
||||
" autocmd FileType cpp set commentstring=//\ %s
|
||||
|
||||
" map <C-\> :Commentary<CR>
|
||||
|
||||
inoremap <C-v> <ESC>"+pa
|
||||
vnoremap <C-c> "+y
|
||||
vnoremap <C-d> "+d
|
||||
" vnoremap <C-A-l> :ClangFormat<CR>:w<CR>
|
||||
" nnoremap <C-A-l> :ClangFormat<CR>:w<CR>
|
||||
vnoremap <C-A-l> :YcmCompleter Format<CR>:w<CR>
|
||||
nnoremap <C-A-l> :YcmCompleter Format<CR>:w<CR>
|
||||
|
||||
" imap jk <Esc>
|
||||
" imap kj <Esc>
|
||||
" imap ло <Esc>
|
||||
" imap ол <Esc>
|
||||
|
||||
nnoremap <nowait> ] ]]
|
||||
nnoremap <nowait> [ [[
|
||||
|
||||
set langmap=ёйцукенгшщзхъфывапролджэячсмитьбю;`qwertyuiop[]asdfghjkl\;'zxcvbnm\\,.,ЙЦУКЕHГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ;QWERTYUIOP{}ASDFGHJKL:\\"ZXCVBNM<>
|
||||
|
||||
" let g:user_emmet_expandabbr_key='<Tab>'
|
||||
" imap <expr> <tab> emmet#expandAbbrIntelligent("\<tab>")
|
||||
|
||||
"set keymap=russian-jcukenwin
|
||||
"set iminsert=0
|
||||
"
|
||||
"imap <F12> <C-^>
|
||||
"cmap <F12> <C-^>
|
||||
|
||||
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
|
||||
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
|
||||
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
|
||||
if (empty($TMUX))
|
||||
if (has("nvim"))
|
||||
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
|
||||
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
|
||||
endif
|
||||
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
|
||||
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
|
||||
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
|
||||
if (has("termguicolors"))
|
||||
set termguicolors
|
||||
endif
|
||||
endif
|
||||
|
||||
hi Normal guibg=NONE ctermbg=NONE
|
||||
|
||||
map <F4> zc
|
||||
map <F5> zo
|
||||
|
||||
" match ExtraWhitespace '/\s\+$'
|
||||
" highlight ExtraWhitespace ctermbg=red
|
||||
highlight ExtraWhitespace guifg=white
|
||||
match ExtraWhitespace /\s\+$/
|
||||
|
||||
set list listchars=trail:·
|
||||
set nofoldenable
|
||||
|
||||
set mouse=n
|
||||
|
||||
map gn :bn<cr>
|
||||
map gp :bp<cr>
|
||||
map gw :BD<cr>
|
||||
|
||||
map gd :YcmCompleter GoToDefinition<cr>
|
||||
map gf :YcmCompleter FixIt<cr>
|
||||
|
||||
map <F4> :YcmCompleter RefactorRename
|
||||
|
||||
autocmd FileType cpp setlocal commentstring=//\ %s
|
||||
map <C-_> :Commentary<cr>j
|
||||
|
||||
let g:airline_powerline_fonts=1
|
||||
" let g:airline#extensions#tabline#enabled = 1
|
||||
" set linespace=0
|
Loading…
Reference in a new issue