159 lines
3.7 KiB
VimL
159 lines
3.7 KiB
VimL
" actual not required, but explicit better than implicit
|
|
set nocompatible
|
|
|
|
filetype off
|
|
|
|
" general settings
|
|
set encoding=utf-8
|
|
let mapleader=","
|
|
set nu
|
|
set laststatus=2
|
|
set showtabline=2
|
|
set hidden
|
|
set incsearch
|
|
|
|
" case insensitive searching
|
|
set ignorecase
|
|
set smartcase
|
|
|
|
" 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
|
|
|
|
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>
|
|
|
|
" fix alt meta mappings in rxvt
|
|
"inoremap <A-h> <ESC>a
|
|
|
|
" map ctrl-p to fzf
|
|
nnoremap <C-p> :Files<CR>
|
|
|
|
" use jj (et al) to escape insert mode
|
|
inoremap jj <Esc>
|
|
inoremap jk <Esc>
|
|
|
|
" 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>
|
|
|
|
"""""""""""""""""""""""""""""""""""""""
|
|
" nnn - using nnn file manager
|
|
"""""""""""""""""""""""""""""""""""""""
|
|
"map <C-n> :NnnPicker<CR>
|
|
"" Opens the nnn window in a split
|
|
"let g:nnn#layout = { 'left': '~30%' } " or right, up, down
|
|
|
|
" Fix auto-indentation for YAML files
|
|
augroup yaml_fix
|
|
autocmd!
|
|
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab indentkeys-=0# indentkeys-=<:>
|
|
augroup END
|
|
|
|
map <C-n> :NERDTreeToggle<CR>
|
|
|
|
"vim-jedi auto-select first, saves a keystroke
|
|
let g:jedi#popup_select_first = 0
|
|
|
|
"colorizer plugin
|
|
"let g:colorizer_auto_color = 1
|
|
let g:colorizer_auto_filetype='css,html,c'
|
|
|
|
call plug#begin('~/.vim/plugged') " vim-plug
|
|
|
|
Plug 'tpope/vim-fugitive'
|
|
Plug 'vim-scripts/indentpython.vim'
|
|
Plug 'scrooloose/syntastic'
|
|
Plug 'nvie/vim-flake8' " PEP 8 checking plugin
|
|
Plug 'itchyny/lightline.vim'
|
|
Plug 'taohexxx/lightline-buffer'
|
|
Plug 'davidhalter/jedi-vim'
|
|
Plug 'tpope/vim-surround'
|
|
Plug 'wellle/targets.vim'
|
|
Plug 'junegunn/goyo.vim'
|
|
Plug 'junegunn/fzf.vim'
|
|
Plug 'scrooloose/nerdtree'
|
|
Plug 'chrisbra/Colorizer'
|
|
" Colors
|
|
Plug 'arzg/vim-substrata'
|
|
|
|
call plug#end() " end vim-plug
|
|
|
|
filetype plugin indent on " required
|
|
|
|
"lightline colorscheme
|
|
let g:lightline = {'colorscheme': 'powerline',}
|
|
|
|
" use lightline-buffer in lightline
|
|
let g:lightline = {
|
|
\ 'tabline': {
|
|
\ 'left': [ [ 'bufferinfo' ],
|
|
\ [ 'separator' ],
|
|
\ [ 'bufferbefore', 'buffercurrent', 'bufferafter' ], ],
|
|
\ 'right': [ [ 'close' ], ],
|
|
\ },
|
|
\ 'component_expand': {
|
|
\ 'buffercurrent': 'lightline#buffer#buffercurrent',
|
|
\ 'bufferbefore': 'lightline#buffer#bufferbefore',
|
|
\ 'bufferafter': 'lightline#buffer#bufferafter',
|
|
\ },
|
|
\ 'component_type': {
|
|
\ 'buffercurrent': 'tabsel',
|
|
\ 'bufferbefore': 'raw',
|
|
\ 'bufferafter': 'raw',
|
|
\ },
|
|
\ 'component_function': {
|
|
\ 'bufferinfo': 'lightline#buffer#bufferinfo',
|
|
\ },
|
|
\ 'component': {
|
|
\ 'separator': '',
|
|
\ },
|
|
\ }
|