Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
- " "
- " __ _ _ _ __ ___ _ __ ___ "
- " \ \ / / | '_ ` _ \| '__/ __| "
- " \ V /| | | | | | | | | (__ "
- " \_/ |_|_| |_| |_|_| \___| "
- " "
- " Author: Łukasz Seremak "
- " Mail: lukasz.seremak@outlook.com "
- " "
- "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
- runtime! archlinux.vim
- """" START Plug Configuration
- if empty(glob('~/.vim/autoload/plug.vim'))
- silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
- \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
- autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
- endif
- set nocompatible
- syntax on
- set nowrap
- set encoding=utf8
- " Use Unix as the standard file type
- set ffs=unix,dos,mac
- " set the runtime path to include Vundle and initialize
- call plug#begin('~/.vim/plugged')
- Plug 'lukaszseremak/spacegrayy'
- Plug 'vim-airline/vim-airline'
- Plug 'vim-airline/vim-airline-themes'
- Plug 'davidhalter/jedi-vim'
- Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
- Plug 'xuyuanp/nerdtree-git-plugin'
- Plug 'airblade/vim-gitgutter'
- Plug 'heavenshell/vim-pydocstring', { 'on': 'Pydocstring' }
- Plug 'mhinz/vim-startify'
- Plug 'Raimondi/delimitMate'
- Plug 'tmhedberg/SimpylFold'
- Plug 'tpope/vim-fugitive'
- Plug 'janko-m/vim-test', { 'for': 'python' }
- Plug 'ambv/black', { 'on': 'Black' }
- Plug 'bronson/vim-trailing-whitespace'
- Plug 'tpope/vim-surround'
- " Plug 'w0rp/ale'
- Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
- Plug 'junegunn/fzf.vim'
- " Plug 'majutsushi/tagbar', { 'on': 'TagbarToggle' }
- " Plug 'xolox/vim-easytags'
- Plug 'editorconfig/editorconfig-vim'
- Plug 'xuhdev/vim-latex-live-preview'
- call plug#end()
- filetype plugin indent on " required
- """" END Plug Configuration
- "define a group `vimrc` and initialize
- augroup vimrc
- autocmd!
- augroup END
- " Theme and Styling
- " so ~/.vim/bundle/colors/spacegray.vim
- colorscheme spacegrayy
- set termguicolors
- set t_Co=256
- let base16colorspace=256 " Access colors present in 256 colorspace
- " Basic configure
- set shiftwidth=4
- set softtabstop=4
- set smartindent
- set expandtab
- set path+=**
- set rnu
- set wildmenu
- set wildmode=list:longest,full " configure wildmenu tab completion
- set wildignorecase
- set hidden
- set showmatch " highlight matching parenthesis
- set mat=2 " How many tenths of a second to blink when matching brackets
- set ttyfast " terminal acceleration
- set laststatus=2 " Always display the status line
- set clipboard=unnamed
- set nobackup " no backup files
- set nowritebackup
- set noswapfile
- set history=500
- set autoread " Set to auto read when a file is changed from the outside
- " set lazyredraw " Don't redraw while executing macros (good performance config)
- let g:elite_mode=1 " Enable Elite mode, no arrows
- let mapleader=','
- " Spell-check set to F6:
- map <F6> :setlocal spell! spelllang=en_us<CR>
- " Maintain undo history between sessions
- set undofile
- set undodir=~/.vim/undodir
- " Add a bit extra margin to the left
- set foldcolumn=1
- " OSX backspace fix
- set backspace=indent,eol,start
- " new line without invoke insert mode
- nmap OO o<Esc>k
- " disabling syntax highlighting after 128 columns
- set cursorline
- " set synmaxcol=150
- " Disable mouse
- set mouse=
- set ttymouse=
- " :W sudo saves the file
- command! W w !sudo tee % > /dev/null
- " Move VISUAL LINE selection within buffer.
- vnoremap K :move '<-2<CR>gv=gv
- vnoremap J :move '>+1<CR>gv=gv
- " Ignore compiled files
- set wildignore=*.o,*~,*.pyc
- set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
- " Visual mode pressing * or # searches for the current selection
- vnoremap <silent> * :<C-u>call VisualSelection('', '')<CR>/<C-R>=@/<CR><CR>
- vnoremap <silent> # :<C-u>call VisualSelection('', '')<CR>?<C-R>=@/<CR><CR>
- " Disable scrollbars
- set guioptions-=r
- set guioptions-=R
- set guioptions-=l
- set guioptions-=L
- "Make the 151st column stand out
- if exists('+colorcolumn')
- set colorcolumn=151
- else
- au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>151v.\+', -1)
- endif
- " Python default config
- let python_highlight_all = 1
- au BufNewFile,BufRead *.py
- \ set tabstop=4 |
- \ set softtabstop=4 |
- \ set shiftwidth=4 |
- \ set expandtab |
- \ set autoindent |
- \ set fileformat=unix
- " vim-airline/vim-airline
- let g:airline_theme='powerlineish'
- let g:airline#extensions#tabline#enabled = 1
- let g:airline#extensions#virtualenv#enabled = 1
- let g:airline_detect_modified=1
- let g:airline_detect_spell=1
- let g:airline_powerline_fonts = 1
- let g:airline_symbols_ascii = 1
- " davidhalter/jedi-vim
- autocmd vimrc FileType python setlocal completeopt-=preview
- let g:jedi#use_splits_not_buffers = "right"
- let g:jedi#completions_command = "<c-n>"
- let g:SuperTabDefaultCompletionType = "context"
- let g:jedi#popup_on_dot = 0
- " scrooloose/nerdtree
- autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
- nmap t :NERDTreeToggle<CR>
- let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
- " airblade/vim-gitgutter
- set updatetime=1000
- nmap ]h <Plug>GitGutterNextHunk
- nmap [h <Plug>GitGutterPrevHunk
- " Raimondi/delimitMate
- let delimitMate_matchpairs = "(:),[:],{:},<:>"
- " tmhedberg/SimpylFold
- let g:SimpylFold_docstring_preview = 1
- " ambv/black
- let g:black_linelength = 120
- let g:black_skip_string_normalization = 1
- " janko-m/vim-test
- let test#python#runner = 'pytest'
- " " w0rp/ale
- " let g:ale_lint_on_enter = 1
- " let g:ale_set_loclist = 1
- " let g:ale_set_highlights = 1
- " let g:ale_completion_enabled = 1
- " let g:ale_maximum_file_size = 50000 " Don't lint large files (> 50KB), it can slow things down
- " let g:ale_lint_delay = 5000
- " let g:ale_linters = {
- " \ 'cpp': ['clang'],
- " \ 'python': ['pylint', 'flake8', 'pycodestyle'],
- " \}
- "
- " let python_max_line_length = '--max-line-length=150'
- " let g:ale_python_pylint_options = python_max_line_length
- " let g:ale_python_pycodestyle_options = python_max_line_length
- " let g:ale_python_flake8_options = python_max_line_length
- "
- " " change the format for echo messages
- " let g:ale_echo_msg_error_str = 'E'
- " let g:ale_echo_msg_warning_str = 'W'
- " let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
- " navigate between errors quickly
- nmap <silent> <C-k> <Plug>(ale_previous_wrap)
- nmap <silent> <C-j> <Plug>(ale_next_wrap)
- " junegunn/fzf.vim
- function! FZFOpen(command_str)
- if (expand('%') =~# 'NERD_tree' && winnr('$') > 1)
- exe "normal! \<c-w>\<c-w>"
- endif
- exe 'normal! ' . a:command_str . "\<cr>"
- endfunction
- let g:fzf_action = {
- \ 'ctrl-t': 'tab split',
- \ 'ctrl-x': 'split',
- \ 'ctrl-v': 'vsplit' }
- let g:fzf_colors =
- \ { 'fg': ['fg', 'Normal'],
- \ 'bg': ['bg', 'Normal'],
- \ 'hl': ['fg', 'Comment'],
- \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
- \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
- \ 'hl+': ['fg', 'Statement'],
- \ 'info': ['fg', 'PreProc'],
- \ 'border': ['fg', 'Ignore'],
- \ 'prompt': ['fg', 'Conditional'],
- \ 'pointer': ['fg', 'Exception'],
- \ 'marker': ['fg', 'Keyword'],
- \ 'spinner': ['fg', 'Label'],
- \ 'header': ['fg', 'Comment'] }
- imap <c-x><c-f> <plug>(fzf-complete-path)
- imap <c-x><c-l> <plug>(fzf-complete-line)
- nnoremap <silent> <C-p> :call FZFOpen(':Files')<CR>
- nnoremap <silent> <C-g>l :call FZFOpen(':BLines')<CR>
- nnoremap <silent> <C-g>w :call FZFOpen(':Windows')<CR>
- nnoremap <silent> <C-g>t :call FZFOpen(':BTags')<CR>
- nnoremap <silent> <C-g>bc :call FZFOpen(':BCommits')<CR>
- nnoremap <silent> <C-g>c :Commands<CR>
- " " majutsushi/tagbar
- " autocmd FileType tagbar setlocal nocursorline nocursorcolumn
- " nmap <F8> :TagbarToggle<CR>
- " let g:tagbar_autoclose = 1
- " let g:tagbar_autofocus = 1
- " let g:tagbar_map_openallfolds = "zi"
- " let g:tagbar_map_closeallfolds = "zc"
- " let g:tagbar_map_nexttag = "n"
- " let g:tagbar_map_prevtag = "p"
- " let g:tagbar_sort = 0
- " let g:tagbar_autofocus = 1
- " let g:tagbar_case_insensitive = 1
- " let g:tagbar_show_linenumbers = 2
- "
- "
- " " xolox/vim-easytags
- " let g:easytags_async = 1
- " let g:ycm_collect_identifiers_from_tags_files=0
- " let g:easytags_syntax_keyword = 'always'
- " let g:easytags_file = '~/.vim/tags'
- " xuhdev/vim-latex-live-preview
- autocmd Filetype tex setl updatetime=1
- let g:livepreview_previewer = 'xreader'
- function! VisualSelection(direction, extra_filter) range
- let l:saved_reg = @"
- execute "normal! vgvy"
- let l:pattern = escape(@", "\\/.*'$^~[]")
- let l:pattern = substitute(l:pattern, "\n$", "", "")
- if a:direction == 'gv'
- call CmdLine("Ack '" . l:pattern . "' " )
- elseif a:direction == 'replace'
- call CmdLine("%s" . '/'. l:pattern . '/')
- endif
- let @/ = l:pattern
- let @" = l:saved_reg
- endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement