Skip to content

Instantly share code, notes, and snippets.

@Nyubis
Last active January 9, 2018 07:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nyubis/658df58ac56d1d6f81033340bfbe7b4b to your computer and use it in GitHub Desktop.
Save Nyubis/658df58ac56d1d6f81033340bfbe7b4b to your computer and use it in GitHub Desktop.
""Plugins
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'wting/rust.vim'
Plugin 'kien/ctrlp.vim'
Plugin 'justinmk/vim-sneak'
Plugin 'terryma/vim-multiple-cursors'
call vundle#end()
let g:airline_left_sep=' '
let g:airline_right_sep=' '
set laststatus=2
"" General
set backspace=2
set showcmd
set number
set relativenumber
set t_Co=256
set mouse=a
set cursorline
syntax on
filetype plugin indent on
cmap w!! w !sudo tee % > /dev/null
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc,.png,.jpg
"" Theme + fixes
let $NVIM_TUI_ENABLE_TRUE_COLOR=1 "(neovim only) use 2^24 colors instead of 256
colorscheme molokai
let g:molokai_original=1 "Better background color
let g:airline_theme='bubblegum'
hi SpecialKey gui=none
hi Special gui=none
" Have matching paren highlighting not be confusing with cursor
hi MatchParen cterm=underline ctermfg=none ctermbg=none
"" Whitespace
set tabstop=4
set shiftwidth=4
set scrolloff=3 "Leave 3 lines of space below/above cursor when scrolling
set nowrap
"" Show invisible characters. ctermfg 0 should be a low-contrast colour
set list
set listchars=tab:»\ ,trail:·
hi SpecialKey ctermfg=0
"" Searching
set hlsearch
set incsearch
set ignorecase
set smartcase
" Clear highlight by pressing esc in normal mode
nnoremap <esc><esc> :noh<return><esc>
"" vim-sneak using s in command mode because we don't use surround.vim
omap s <Plug>Sneak_s
omap S <Plug>Sneak_S
" "" Fix magic mode
" nnoremap / /\v
" vnoremap / /\v
" cnoremap %s/ %smagic/
" cnoremap \>s/ \>smagic/
" nnoremap :g/ :g/\v
" nnoremap :g// :g//
"" Tab switching
nnoremap <F7> :tabprevious<CR>
nnoremap <F8> :tabnext<CR>
inoremap <F7> <Esc>:tabprevious<CR>
inoremap <F8> <Esc>:tabnext<CR>
tnoremap <F7> <C-\><C-n>:tabprevious<CR>
tnoremap <F8> <C-\><C-n>:tabnext<CR>
"" Keep backup files in one place instead of littering all over
set backupdir=~/.vim/.backup
set directory=~/.vim/.backup
"" Command for writing text rather than code
function! Writing()
set wrap
set linebreak
set nolist
set spell
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment