Skip to content

Instantly share code, notes, and snippets.

Last active Nov 29, 2020
What would you like to do?
Vim configuration as Python IDE (and also C, tex/latex and Julia)
syntax enable
colorscheme vimbrains
"modern vim
set nocompatible
set backspace=indent,eol,start
" folding for python style
au BufNewFile,BufRead *.py set foldmethod=indent
set modelines=0
set nu
set spell
set spelllang=en,ru
set expandtab
set tabstop=2
set shiftwidth=2
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
"Automatically change the current directory
set autochdir
"look for a tags file in the directory of the current file, then upward until / and in the working directory, then upward until /
set tags=./tags;,tags;
call plug#begin('~/.vim/plugged')
Plug 'JuliaEditorSupport/julia-vim'
Plug 'jpalardy/vim-slime'
Plug 'scrooloose/nerdtree'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
Plug 'godlygeek/tabular'
Plug 'plasticboy/vim-markdown'
Plug 'rhysd/vim-clang-format'
Plug 'justmao945/vim-clang'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'lervag/vimtex'
Plug 'dense-analysis/ale'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
call plug#end()
"plugins configs
let g:slime_target = "vimterminal"
let g:slime_python_ipython = 1
map <C-n> :NERDTreeToggle<CR>
let g:NERDTreeWinSize=80
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffer_idx_mode = 1
nmap <leader>1 <Plug>AirlineSelectTab1
nmap <leader>2 <Plug>AirlineSelectTab2
nmap <leader>3 <Plug>AirlineSelectTab3
nmap <leader>4 <Plug>AirlineSelectTab4
nmap <leader>5 <Plug>AirlineSelectTab5
nmap <leader>6 <Plug>AirlineSelectTab6
nmap <leader>7 <Plug>AirlineSelectTab7
nmap <leader>8 <Plug>AirlineSelectTab8
nmap <leader>9 <Plug>AirlineSelectTab9
nmap <F5> <Plug>AirlineSelectPrevTab
nmap <F6> <Plug>AirlineSelectNextTab
"let g:airline_section_b = '%{strftime("%d/%m/%Y %H:%M")}'
let g:airline#extensions#whitespace#enabled = 0
let g:vim_markdown_folding_disabled = 1
let g:vim_markdown_toc_autofit = 1
"python linter works over coc plugin
let g:ale_linters = {'c': ['clang'], 'tex': ['chktex']}
"let g:ale_julia_executable = '/Applications/'
"coc config
" python plugin
" snippets plugin
" vimtex plugin
" to update plugins use CocUpdate
" see .vim/coc-settings.json !!
" Formatting selected code.
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
" Use K to show documentation in preview window.
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
elseif (coc#rpc#ready())
call CocActionAsync('doHover')
execute '!' . &keywordprg . " " . expand('<cword>')
" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Symbol renaming.
nmap <leader>rn <Plug>(coc-rename)
" Trigger configuration. Do not use <tab> if you use
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
let g:tex_flavor = "latex"
let g:tex_flavor='latex'
let g:vimtex_view_method='mupdf'
let g:vimtex_quickfix_open_on_warning=0
"status line
set laststatus=2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment