Skip to content

Instantly share code, notes, and snippets.

@rage311
Created April 24, 2018 19:06
Show Gist options
  • Save rage311/543c49799b7b02198329529077cd4fdd to your computer and use it in GitHub Desktop.
Save rage311/543c49799b7b02198329529077cd4fdd to your computer and use it in GitHub Desktop.
Neovim vimrc (~/.config/neovim/init.vim)
" vim-plug stuff
call plug#begin('~/.local/share/nvim/plugged')
"Plug 'VundleVim/Vundle.vim'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'tommcdo/vim-lion'
Plug 'sheerun/vim-polyglot'
Plug 'flazz/vim-colorschemes'
" Asynchronous linting
Plug 'w0rp/ale'
Plug 'tpope/vim-commentary'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'tpope/vim-dadbod'
call plug#end()
let g:ale_perl_perlcritic_options = '--exclude ProhibitSubroutinePrototypes --exclude RequireUseStrict'
let g:ale_perl_perlcritic_showrules = 1
let perl_sub_signatures = 1
nnoremap <SPACE> <Nop>
let mapleader=" "
set ts=2
set sts=2
set sw=2
set expandtab
set number
set relativenumber
set colorcolumn=80
set scrolloff=10
set cursorline
vmap <C-c> y: call system("xclip -i -selection clipboard", getreg("\""))<CR>
" Quicker window movement
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
" Navigate properly when lines are wrapped
nnoremap j gj
nnoremap k gk
" Make searching better
"set gdefault " Never have to type /g at the end of search / replace again
nnoremap <silent> <leader>, :noh<cr> "Stop highlight after searching
set showmatch
nnoremap <leader>. :CtrlPTag<cr>
"let g:rehash256 = 1
"let g:molokai_original = 1
"colorscheme molokai
colorscheme Monokai
" To open a new empty buffer
" This replaces :tabnew which I used to bind to this mapping
nmap <leader>T :enew<cr>
" Move to the next buffer
nmap <leader>l :bnext<CR>
" Move to the previous buffer
nmap <leader>h :bprevious<CR>
" Close the current buffer and move to the previous one
" This replicates the idea of closing a tab
nmap <leader>bq :bp <BAR> bd #<CR>
" Show all open buffers and their status
nmap <leader>bl :ls<CR>
" Set the command window height to 2 lines, to avoid many cases of having to
" press <Enter> to continue"
set cmdheight=2
" Quickly time out on keycodes, but never time out on mappings
set notimeout ttimeout ttimeoutlen=100
" Use <F11> to toggle between 'paste' and 'nopaste'
set pastetoggle=<F11>
" Use case insensitive search, except when using capital letters
set ignorecase
set smartcase
set hidden
set mouse=a
let g:airline_powerline_fonts = 1
let g:airline_theme='zenburn'
" buffer/tabs status bar at top
let g:airline#extensions#tabline#enabled = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_symbols.space = "\ua0"
"
" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
let g:airline_symbols.crypt = '🔒'
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = '␤'
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.maxlinenr = '☰'
let g:airline_symbols.maxlinenr = ''
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.spell = 'Ꞩ'
let g:airline_symbols.notexists = '∄'
let g:airline_symbols.whitespace = 'Ξ'
" powerline symbols
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment