Skip to content

Instantly share code, notes, and snippets.

@plasticuproject
Last active December 19, 2022 15:04
Show Gist options
  • Select an option

  • Save plasticuproject/2b800b5d8b31161885366e5746e50fa5 to your computer and use it in GitHub Desktop.

Select an option

Save plasticuproject/2b800b5d8b31161885366e5746e50fa5 to your computer and use it in GitHub Desktop.
neovim config
" pip install neovim flake8 pylint jedi yapf pynvim
call plug#begin('~/.local/share/nvim/plugged')
Plug 'davidhalter/jedi-vim'
Plug 'preservim/nerdtree'
Plug 'junegunn/fzf'
Plug 'preservim/nerdcommenter'
Plug 'liuchengxu/vista.vim'
Plug 'jeetsukumaran/vim-pythonsense'
Plug 'jiangmiao/auto-pairs'
Plug 'Vimjas/vim-python-pep8-indent'
Plug 'dense-analysis/ale'
Plug 'sheerun/vim-polyglot'
Plug 'https://github.com/joshdick/onedark.vim.git'
Plug 'Shougo/deoplete.nvim'
Plug 'zchee/deoplete-jedi'
Plug 'tpope/vim-fugitive'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'airblade/vim-gitgutter'
Plug 'machakann/vim-highlightedyank'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'deoplete-plugins/deoplete-clang'
Plug 'sbdchd/neoformat'
Plug 'Shougo/neoinclude.vim'
Plug 'rust-lang/rust.vim'
Plug 'instant-markdown/vim-instant-markdown', {'for': 'markdown', 'do': 'yarn install'}
Plug 'ghifarit53/tokyonight-vim'
Plug 'Yggdroot/indentLine'
Plug 'tweekmonster/django-plus.vim'
call plug#end()
" python folding
au BufNewFile,BufRead *.py
\ set foldmethod=indent
nnoremap <space> za
" autopairs
au BufNewFile,BufRead *.html
\ let g:AutoPairs = AutoPairsDefine({'<!--' : '-->', '<' : '>', '{%' : '%}'}, [])
" automatically close the method preview window
au InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif
" disable autocompletion, because we use deoplete for completion
let g:jedi#completions_enabled = 0
" open the go-to function in split, not another buffer
"let g:jedi#use_splits_not_buffers = 'right'
let g:jedi#use_tabs_not_buffers = 1
" nerdtree settings
let g:NERDTreeGitStatusUseNerdFonts = 1
let g:NERDTreeGitStatusIndicatorMapCustom = {
\ 'Modified' :'✹',
\ 'Staged' :'✚',
\ 'Untracked' :'✭',
\ 'Renamed' :'➜',
\ 'Unmerged' :'═',
\ 'Deleted' :'✖',
\ 'Dirty' :'✗',
\ 'Ignored' :'☒',
\ 'Clean' :'✔︎',
\ 'Unknown' :'?',
\ }
let g:NERDTreeGitStatusShowIgnored = 1
let g:NERDTreeGitStatusUntrackedFilesMode = 'all'
let g:NERDTreeGitStatusShowClean = 1
let g:NERDTreeGitStatusConcealBrackets = 1
" set highlight duration time to 3000 ms, i.e., 5 second
let g:highlightedyank_highlight_duration = 3000
" deoplete settings
let g:deoplete#enable_at_startup = 1
let g:deoplete#sources#clang#libclang_path = '/usr/lib/llvm-6.0/lib/libclang.so.1'
let g:deoplete#sources#clang#clang_header = '/usr/lib/llvm-6.0/lib/clang'
" custom setting for clangformat
let g:neoformat_cpp_clangformat = {
\ 'exe': 'clang-format',
\ 'args': ['--style="{IndentWidth: 4}"']
\}
let g:neoformat_enabled_cpp = ['clangformat']
let g:neoformat_enabled_c = ['clangformat']
" set hybrid numbers
set number relativenumber
" Ale settings
let g:ale_linters = {
\ 'python': ['flake8', 'pylint', 'mypy'],
\ 'cpp': ['clang'],
\ 'c': ['clang'],
\ 'javascript': ['eslint', 'prettier'],
\ 'typescript': ['eslint', 'prettier'],
\ 'rust': ['analyzer'],
\}
let g:ale_fixers = {
\ 'python': ['yapf', 'trim_whitespace', 'remove_trailing_lines'],
\ 'rust': ['rustfmt', 'trim_whitespace', 'remove_trailing_lines'],
\ 'javascript': ['eslint', 'trim_whitespace', 'remove_trailing_lines'],
\ 'typescript': ['eslint', 'trim_whitespace', 'remove_trailing_lines'],
\ 'c': ['trim_whitespace', 'remove_trailing_lines'],
\ 'cpp': ['trim_whitespace', 'remove_trailing_lines'],
\}
nmap <F10> :ALEFix<CR>
let g:ale_fix_on_save = 1
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
" Airline
let g:airline_left_sep = ''
let g:airline_right_sep = ''
let g:airline#extensions#ale#enabled = 1
let airline#extensions#ale#error_symbol = 'E:'
let airline#extensions#ale#warning_symbol = 'W:'
let g:airline_theme='minimalist'
" Indent Guides
set ai ts=4 sw=4 et sts=4
au BufNewFile,BufRead *.ts set ts=2 sw=2 et
au BufNewFile,BufRead *.tsx set ts=2 sw=2 et
au BufNewFile,BufRead *.js set ts=2 sw=2 et
au BufNewFile,BufRead *.jsx set ts=2 sw=2 et
let g:vim_json_conceal=0
let g:markdown_syntax_conceal=0
let g:indentLine_char_list = ['|', '¦', '┆', '┊']
let g:indentLine_enabled = 1
" rustfmt stuff
au BufNewFile,BufRead *.rs set filetype=rust
filetype plugin indent on
" let g:rustfmt_autosave = 1
" nnoremap <C-LeftMouse> :ALEGoToDefinition<CR>
" theme stuff
syntax on
" colorscheme onedark
set termguicolors
let g:tokyonight_style = 'night' " available: night, storm
let g:tokyonight_enable_italic = 1
let g:tokyonight_transparent_background = 1
colorscheme tokyonight
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment