Last active
December 28, 2021 20:32
-
-
Save nikneroz/571f9b3c58b9b998e112ea1ecdced4e3 to your computer and use it in GitHub Desktop.
Neovim config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if &compatible | |
set nocompatible " Be iMproved | |
endif | |
" Required: | |
call plug#begin('~/.cache/vim-plug') | |
" Autocomplete && Syntax checker | |
" Elixir coc settings: https://github.com/JakeBecker/vscode-elixir-ls/blob/master/package.json | |
source $HOME/.config/nvim/modules/coc.vimrc | |
" Vim eco-system: | |
Plug 'scrooloose/nerdtree' | |
Plug 'Xuyuanp/nerdtree-git-plugin' | |
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } | |
Plug 'junegunn/fzf.vim' | |
Plug 'dyng/ctrlsf.vim' | |
Plug 'itchyny/lightline.vim' | |
Plug 'itchyny/vim-gitbranch' | |
Plug 'ap/vim-buftabline' | |
Plug 'majutsushi/tagbar' | |
" Utils for development | |
Plug 'terryma/vim-multiple-cursors' | |
Plug 'tpope/vim-surround' | |
Plug 'preservim/nerdcommenter' | |
Plug 'ryanoasis/vim-devicons' | |
Plug 'tpope/vim-fugitive' | |
Plug 'airblade/vim-gitgutter' | |
" Syntax plugins | |
Plug 'sheerun/vim-polyglot' | |
Plug 'fatih/vim-go' | |
Plug 'RRethy/vim-hexokinase', { 'do': 'make hexokinase' } | |
" Themes | |
Plug 'dracula/vim' | |
Plug 'flazz/vim-colorschemes' | |
Plug 'xolox/vim-misc' | |
Plug 'xolox/vim-colorscheme-switcher' | |
Plug 'sonph/onehalf', { 'rtp': 'vim' } | |
call plug#end() | |
" let g:python_host_prog = '/Users/rozenkin/.pyenv/versions/neovim2/bin/python' | |
" let g:python3_host_prog = '/Users/rozenkin/.pyenv/versions/neovim3/bin/python' | |
let g:python_host_prog = '/usr/bin/python' | |
let g:python3_host_prog = '/usr/bin/python3' | |
" Required: | |
set undofile | |
set undodir=~/.config/nvim/undodir | |
" Favorite themes: dracula iceberg hybrid solarized bvemu busybee monokai Molokai wombat256mod Tomorrow-Night up lilypink 256-grayvim 256-jungle babymate256 blacklight 1989 | |
colorscheme onehalfdark | |
set encoding=UTF-8 | |
set termencoding=UTF-8 | |
set backupcopy=yes | |
set hlsearch | |
set backspace+=start,eol,indent | |
set number | |
set smartindent | |
set tabstop=2 | |
set shiftwidth=2 | |
set expandtab | |
set termguicolors | |
set fillchars+=stl:\ ,stlnc:\ | |
set laststatus=2 | |
set lazyredraw | |
set lz | |
set colorcolumn=120 | |
set hidden | |
set nofoldenable | |
set shell=/bin/bash | |
set cmdheight=1 | |
set clipboard=unnamedplus | |
set modifiable | |
set mmp=4000 | |
set t_Co=256 | |
set cursorline | |
if exists('+termguicolors') | |
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum" | |
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum" | |
set termguicolors | |
endif | |
autocmd FileType vue syntax sync fromstart | |
autocmd BufNewFile,BufRead *.tsx,*.jsx set filetype=typescript.tsx | |
let mapleader = "\<Space>" | |
let g:Hexokinase_highlighters = ['backgroundfull'] | |
let NERDDefaultAlign="left" | |
let g:NERDSpaceDelims = 1 | |
let g:NERDTrimTrailingWhitespace = 1 | |
let g:NERDToggleCheckAllLines = 1 | |
let g:NERDCustomDelimiters = | |
\ { | |
\ 'javascript.jsx': { | |
\ 'left': '//', | |
\ 'leftAlt': '{/*', | |
\ 'rightAlt': '*/}' | |
\ }, | |
\ 'typescript.tsx': { | |
\ 'left': '//', | |
\ 'leftAlt': '{/*', | |
\ 'rightAlt': '*/}' | |
\ } | |
\ } | |
" + Search by filename | |
nnoremap <silent> <C-f> :Files<CR> | |
nmap <Leader>f <Plug>CtrlSFPrompt | |
let g:ctrlsf_auto_focus = { "at": "start" } | |
" - Search by filename | |
" + File path in lightline | |
let g:lightline = | |
\ { | |
\ 'colorscheme': 'onehalfdark', | |
\ 'active': { | |
\ 'left': [ | |
\ [ 'mode', 'paste' ], | |
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] | |
\ ] | |
\ }, | |
\ 'component_function': { | |
\ 'gitbranch': 'gitbranch#name' | |
\ } | |
\ } | |
" - File path in lightline | |
" + Fast buffer switchers | |
nmap <c-j> <c-w>j | |
nmap <c-k> <c-w>k | |
nmap <c-h> <c-w>h | |
nmap <c-l> <c-w>l | |
" - Fast buffer switchers | |
" + Buffers switch | |
nnoremap <Leader>[ :bprevious<CR> | |
nnoremap <Leader>] :bnext<CR> | |
" - Buffers switch | |
nnoremap <S-Down> <c-w>+ | |
nnoremap <S-Up> <c-w>- | |
nnoremap <S-Left> <c-w>< | |
nnoremap <S-Right> <c-w>> | |
" + Terminal: exit from insert mode and switch tab | |
tnoremap <Leader>[ <C-\><C-n>:bprevious<CR> | |
tnoremap <Leader>] <C-\><C-n>:bnext<CR> | |
" - Terminal: exit from insert mode and switch tab | |
" + Open NerdTree | |
nmap <c-i> :NERDTreeToggle<CR> | |
let g:NERDTreeGitStatusUseNerdFonts = 1 | |
let g:NERDTreeShowHidden = 1 | |
let g:NERDTreeMinimalUI = 1 | |
let g:NERDTreeIgnore = [] | |
let g:NERDTreeChDirMode = 2 | |
let NERDTreeIgnore=['__pycache__'] | |
" let g:NERDTreeStatusline = '' | |
" Automaticaly close nvim if NERDTree is only thing left open | |
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif | |
" - Open NerdTree | |
" + Open Tagbar | |
nmap <c-d> :TagbarToggle<CR> | |
let g:tagbar_autoclose = 1 | |
let g:tagbar_autofocus = 1 | |
" - Open Tagbar | |
" | |
" + ColorTheme Switch | |
nnoremap <Leader>p :NextColorScheme<CR> | |
nnoremap <Leader>o :PrevColorScheme<CR> | |
" - ColorTheme Switch | |
" + Search by word within visual selection | |
vnoremap // y/<C-R>"<CR> | |
" - Search by word within visual selection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment