Skip to content

Instantly share code, notes, and snippets.

@andrewhummus
Last active September 4, 2022 16:03
Show Gist options
  • Save andrewhummus/abf0686784876d1377040b7cd81e94d0 to your computer and use it in GitHub Desktop.
Save andrewhummus/abf0686784876d1377040b7cd81e94d0 to your computer and use it in GitHub Desktop.
config for nvim
" <essentials>
set nocompatible " don't try to be compatible with V
filetype plugin on
lua require('plugins')
set relativenumber
set termguicolors
set expandtab
set hidden
set tabstop=2
set softtabstop=2
set shiftwidth=2
setlocal textwidth=79
setlocal foldmethod=expr
filetype plugin indent on
syntax on
set t_Co=256
set mouse=a
if &shell =~# 'fish$'
set shell=sh
endif
compiler fish
" </essentials>
" <theme>
set cursorline
colorscheme onehalfdark
let g:airline_theme='onedark'
" </theme>
" <functions>
function! WinMove(key)
let t:curwin = winnr()
exec "wincmd ".a:key
if (t:curwin == winnr())
if (match(a:key,'[jk]'))
wincmd v
else
wincmd s
endif
exec "wincmd ".a:key
endif
endfunction
" </functions>
" <keybinds_and_stuff>
nnoremap <silent> <C-Left> :call WinMove('h')<CR>
nnoremap <silent> <C-Down> :call WinMove('j')<CR>
nnoremap <silent> <C-Up> :call WinMove('k')<CR>
nnoremap <silent> <C-Right> :call WinMove('l')<CR>
nnoremap <A-Down> :m .+1<CR>==
nnoremap <A-Up> :m .-2<CR>==
inoremap <A-Down> <Esc>:m .+1<CR>==gi
inoremap <A-Up> <Esc>:m .-2<CR>==gi
vnoremap <A-Down> :m '>+1<CR>gv=gv
vnoremap <A-Up> :m '<-2<CR>gv=gv
autocmd VimEnter * NERDTree | wincmd p
nnoremap <C-S> :bnext<CR>
nnoremap <C-A> :bprev<CR>
command! -nargs=0 Prettier :CocCommand prettier.formatFile
nmap <C-F>f <Plug>CtrlSFPrompt
nmap <C-F>n <Plug>CtrlSFCwordPath
nmap <C-F>p <Plug>CtrlSFPwordPath
" </keybinds_and_stuff>
local cmd = vim.cmd
return require('packer').startup(function()
use {'raghur/vim-ghost', run = ':GhostInstall'}
use 'wbthomason/packer.nvim' --- Stops Packer from deleting itself during clean-up
use 'tpope/vim-sensible'
use 'vim-airline/vim-airline'
use 'vim-airline/vim-airline-themes'
use 'thehackercoding/onehalf-vim'
use 'rhysd/git-messenger.vim'
use 'randymorris/vim-bufstat'
use 'ap/vim-buftabline'
use 'rust-lang/rust.vim'
use 'preservim/nerdtree' --- NERDTree but cooler :)
use 'wesQ3/vim-windowswap' --- Swap Buffers/Windows
use 'jiangmiao/auto-pairs' --- Pair curly brackets, brackets, etc.
use 'tpope/vim-obsession' --- Better Sessions
use 'machakann/vim-highlightedyank' --- Highlight Yanks
use 'wsdjeg/vim-todo' --- TODO in Vim
use 'tpope/vim-fugitive' --- Vim + Git = <3
use 'airblade/vim-gitgutter' --- Git diff in vim
use {'neoclide/coc.nvim', branch = 'release'}
use 'sheerun/vim-polyglot' --- Syntax Highlighting + fixes a few issues with indent-blankline
use {'nvim-treesitter/nvim-treesitter', run = ':TSUpdate'} --- Advanced Syntax Highlighting
use 'ryanoasis/vim-devicons'
use 'dag/vim-fish'
use 'euclio/vim-markdown-composer'
use 'bfrg/vim-cpp-modern'
use 'dyng/ctrlsf.vim'
use 'pantharshit00/vim-prisma'
use {'RRethy/vim-hexokinase', run = 'make hexokinase'}
use {'mg979/vim-visual-multi', branch = 'master'}
end)
@andrewhummus
Copy link
Author

To install the plugins, first install packer.nvim https://github.com/wbthomason/packer.nvim#quickstart. After add both of these files in ~/.config/nvim. Open nvim and the plugins should install automatically, and boom you are set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment