User Tools

Site Tools


vimrc

This is an old revision of the document!


Install plugin installer Vundle

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

Vim config .vimrc

set nocompatible              " be iMproved, required
filetype off                  " required

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'vim-python/python-syntax'
Plugin 'Vimjas/vim-python-pep8-indent'
Plugin 'davidhalter/jedi-vim'
Plugin 'dense-analysis/ale'
Plugin 'tpope/vim-surround'
Plugin 'preservim/nerdtree'
Plugin 'tpope/vim-fugitive'
Plugin 'frazrepo/vim-rainbow'
Plugin 'vim-airline/vim-airline'
Plugin 'mattn/emmet-vim'
Plugin 'vim-autoformat/vim-autoformat'
Plugin 'nathangrigg/vim-beancount'
Plugin 'tmhedberg/SimpylFold'
Plugin 'vim-syntastic/syntastic'
Plugin 'nvie/vim-flake8'
Plugin 'powerline/powerline'
Plugin 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plugin 'junegunn/fzf.vim'
Plugin 'ycm-core/YouCompleteMe'
call vundle#end()            " required
filetype plugin indent on    " required

let g:jedi#completions_enabled = 1
let g:jedi#popup_on_dot = 1
let g:jedi#show_call_signatures = '0'
let g:jedi#use_tabs_not_buffers = 0

let g:ale_linters = {'python': ['pylint', 'flake8']}
let g:ale_fix_on_save = 1
" let b:ale_fixers = ['prettier', 'eslint']
let b:ale_fixers = ['prettier', 'autopep8']
let g:formatdef_latexindent = '"latexindent -"'

nnoremap <leader>n :NERDTreeFocus<CR>
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
nnoremap <C-f> :NERDTreeFind<CR>

filetype plugin on
syntax on

set number

noremap <F3> :Autoformat<CR>

"split navigations
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>

" Enable folding
set foldmethod=indent
set foldlevel=99

" Enable folding with the spacebar
nnoremap <space> za


au BufNewFile,BufRead *.py
            \ set tabstop=4 |
            \ set softtabstop=4 |
            \ set shiftwidth=4 |
            \ set textwidth=79 |
            \ set expandtab |
            \ set autoindent |
            \ set fileformat=unix
            
set encoding=utf-8

let python_highlight_all=1

set clipboard=unnamed

set background=dark
colorscheme gruvbox

set shiftwidth=4 smarttab
set expandtab
set tabstop=8 softtabstop=0

set hlsearch
set spell
set spelllang=en,pl
hi clear SpellBad
hi SpellBad cterm=underline

set backspace=indent,eol,start
let g:fzf_vim = {}

Install formatters

sudo apt-get install python-autopep8

Install linter

sudo apt install python3-flake8

Enable spell

  1. Start vim
  2. type
    :set spell

    and confirm create location for spell files

Theme

Manual install theme

mkdir -p ~/.vim/colors
cd ~/.vim/colors
wget https://raw.githubusercontent.com/vim-scripts/gruvbox/master/colors/gruvbox.vim

Add to .vimrc

colorscheme gruvbox

Install FNF for search files in Vim

sudo apt-get install fzf silversearcher-ag

For Plugin YouCompleteMe (YCM)

sudo apt install cmake
cd ~/.vim/bundle/YouCompleteMe 
python3 install.py
vimrc.1737066956.txt.gz · Last modified: by karcio