Skip to content

Instantly share code, notes, and snippets.

@arnavb
Created May 13, 2021 22:50
Show Gist options
  • Save arnavb/ba8ec9f1c7ea957b6ec2e54270fd07f5 to your computer and use it in GitHub Desktop.
Save arnavb/ba8ec9f1c7ea957b6ec2e54270fd07f5 to your computer and use it in GitHub Desktop.
My current Neovim config
scriptencoding utf-8
let mapleader = ' '
" Setup vim-plug
call plug#begin('~/.vim/plugged')
Plug 'nanotech/jellybeans.vim'
Plug 'folke/tokyonight.nvim', {'branch': 'main'}
Plug 'Yggdroot/indentLine'
Plug 'lukas-reineke/indent-blankline.nvim' " Connect indentLine guides using virtual text
Plug 'dense-analysis/ale'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'tomtom/tcomment_vim'
Plug 'tweekmonster/startuptime.vim'
call plug#end()
let g:vimsence_small_image = 'neovim'
lua <<EOF
require'nvim-treesitter.configs'.setup {
ensure_installed = "maintained",
highlight = {
enable = true,
},
}
EOF
" Setup theme
set termguicolors
set background=dark
let g:tokyonight_style='night'
colorscheme tokyonight
" indentLine
let g:indentLine_char = '│'
let g:indentLine_showFirstIndentLevel = 1
let g:indentLine_first_char = g:indentLine_char
let g:indent_blankline_extra_indent_level = -1
" Ale
let g:ale_fixers = {
\ '*': [
\ 'remove_trailing_lines',
\ 'trim_whitespace',
\ ],
\ 'python': [
\ 'black',
\ 'isort',
\ ],
\ 'cpp': [
\ 'clang-format',
\ ],
\ 'c': [
\ 'clang-format',
\ ],
\ 'javascript': [
\ 'prettier',
\ 'eslint',
\ ]
\ }
let g:ale_linters = {
\ 'cs': ['OmniSharp']
\ }
let g:ale_sign_error = ' •'
let g:ale_sign_warning = ' •'
let g:ale_sign_info = ' ·'
let g:ale_sign_style_error = ' ·'
let g:ale_sign_style_warning = ' ·'
let g:ale_fix_on_save = 1
let g:ale_c_parse_compile_commands = 1
" Easier window movement mappings
tnoremap <Esc> <C-\><C-n>
nnoremap <C-J> <C-W>j
nnoremap <C-K> <C-W>k
nnoremap <C-L> <C-W>l
nnoremap <C-H> <C-W>h
" Indentation
set tabstop=4
set shiftwidth=4
set expandtab
" Misc
set signcolumn=number
set number relativenumber
set hidden
" set signcolumn=yes
set laststatus=0
set nohlsearch
set inccommand=nosplit " Show live replace preview
set ignorecase smartcase
set splitbelow splitright
set undofile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment