Skip to content

Instantly share code, notes, and snippets.

@danielmiessler
Created August 25, 2019 07:06
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save danielmiessler/3371fc10cc71ce84cdcbc755fb714fb4 to your computer and use it in GitHub Desktop.
Save danielmiessler/3371fc10cc71ce84cdcbc755fb714fb4 to your computer and use it in GitHub Desktop.
My Neovim $VIMRC configuration file
" (Neo)Vim Configuration
" By Daniel Miessler
" August 2019
" BASIC CONFIGURATION
" Remap Escape
inoremap jk <ESC>
" Remap the leader key to the spacebar
let mapleader = "'"
" Run commands with semicolon
nnoremap ; :
" Save the current buffer using the leader key
noremap <Leader>w :w<CR>
" Save and exit Vim using the leader key
noremap <Leader>e :wq<CR>
" Exit without saving using the leader key
noremap <Leader>q :q!<CR>
" Enable syntax highlighting
syntax on
" Set the shell
set shell=/bin/zsh
" Clipboard functionality (paste from system)
vnoremap <leader>y "+y
nnoremap <leader>y "+y
nnoremap <leader>p "+p
vnoremap <leader>p "+p
" Look and feel
"" PLUGIN MANAGEMENT
packadd minpac
call minpac#init()
" Managed plugins (automatically installed and updated via "Pu" and "Pc")
call minpac#add('k-takata/minpac', {'type': 'opt'})
call minpac#add('vim-airline/vim-airline')
call minpac#add('vim-airline/vim-airline-themes')
call minpac#add('MarcWeber/vim-addon-mw-utils')
call minpac#add('garbas/vim-snipmate')
call minpac#add('honza/vim-snippets')
call minpac#add('tpope/vim-repeat')
command! Pu call minpac#update()
command! Pc call minpac#clean()
"" ADDITIONAL CONFIGURATION
" Spelling
nnoremap <leader>sp :set spell<CR>
nnoremap <leader>s ]s
nnoremap <leader>f 1z=
" Line numbers
nnoremap <leader>n :set nonumber!<CR>
nnoremap <leader>rn :set norelativenumber!<CR>
" Clear highlighting
nnoremap <leader>c :nohl<CR>
" Paste mode
nnoremap <leader>pa :set nopaste!<CR>
" Pane navigation
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" Kill the arrow keys
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment