Files
dots/vim/.vimrc

118 lines
2.7 KiB
VimL

set nocompatible
filetype off
" general settings
set encoding=utf-8
let mapleader=","
set nu
set laststatus=2
set showtabline=2
set hidden
set incsearch
" share system clipboard
set clipboard=^unnamed,unnamedplus
" hide showmode because its in statusline
set noshowmode
" Indent settings - PEP8 compatibility
set expandtab
set autoindent
set tabstop=4
set softtabstop=4
set textwidth=79
set shiftwidth=4
set fileformat=unix
"highlight cursorline cterm=none ctermbg=darkred ctermfg=white guibg=darkred guifg=white
hi cursorline cterm=none term=none ctermbg=236
set cursorline
" vertical column at 79 so you know when to wrap
"set colorcolumn=79
"enable relative line numbers
set number relativenumber
"set highlight cursorcolumn cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
nnoremap <Leader>c :set cursorline! cursorcolumn!<CR>
"toggle search hilight with <leader>h
nnoremap <silent><expr> <Leader>h (&hls && v:hlsearch ? ':nohls' : ':set hls')."\n"
"highlight matching brace when closing brace, flash for 2 tenths
set showmatch
set matchtime=2
" python-syntax
let pythong_highlight_all = 1
syntax on
set foldmethod=indent
set foldlevel=99
" specify the location of the splits
set splitbelow
set splitright
" remap ctrl + hjkl to move between splits
nnoremap <C-j> <C-W><C-J>
nnoremap <C-k> <C-W><C-K>
nnoremap <C-l> <C-W><C-L>
nnoremap <C-h> <C-W><C-H>
" map ctrl-p to fzf
nnoremap <C-p> :Files<CR>
" use jj (et al) to escape insert mode
inoremap jj <Esc>
inoremap jk <Esc>
inoremap kj <Esc>
" use jk to escape insert mode - using easyescape plugin
let g:easyescape_chars = { "j": 1, "k": 1 }
let g:easyescape_timeout = 100
" blank lines
nnoremap <Enter> o<ESC>
nnoremap <S-Enter> O<ESC>
nnoremap <leader>l :ls<CR>:b<Space>
nnoremap <Tab> :bnext<CR>
nnoremap <S-Tab> :bprev<CR>
nnoremap <space> za
" NERDTree, open/close toggle
map <C-n> :NERDTreeToggle<CR>
"lightline colorscheme
let g:lightline = {'colorscheme': 'wombat',}
"vim-jedi auto-select first, saves a keystroke
let g:jedi#popup_select_first = 0
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" " let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'scrooloose/nerdtree'
Plugin 'tmhedberg/SimpylFold'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'scrooloose/syntastic'
Plugin 'nvie/vim-flake8' " PEP 8 checking plugin
Plugin 'itchyny/lightline.vim'
Plugin 'klen/python-mode'
Plugin 'davidhalter/jedi-vim'
Plugin 'tpope/vim-surround'
Plugin 'ap/vim-buftabline'
Plugin 'wellle/targets.vim'
Plugin 'junegunn/goyo.vim'
Plugin 'zhou13/vim-easyescape'
Plugin 'junegunn/fzf.vim'
Plugin 'mcchrish/nnn.vim'
call vundle#end() " required
filetype plugin indent on " required