about summary refs log tree commit diff
path: root/.vim
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2020-07-18 14:18:21 -0500
committerStarfall <us@starfall.systems>2020-07-18 14:18:21 -0500
commit19c591315da3c2488f3b00a6b4003387c1c71490 (patch)
treee32fda028bad57b34fc1bbb74519e8eaf3bdfe2a /.vim
parent61ce9f69ea9f1a617659ad5760533fd67e0f0d5c (diff)
vim: restore old config
Diffstat (limited to '.vim')
-rw-r--r--.vim/ftplugin/yaml.vim2
-rw-r--r--.vim/vimrc85
2 files changed, 87 insertions, 0 deletions
diff --git a/.vim/ftplugin/yaml.vim b/.vim/ftplugin/yaml.vim
new file mode 100644
index 0000000..24241cb
--- /dev/null
+++ b/.vim/ftplugin/yaml.vim
@@ -0,0 +1,2 @@
+setlocal expandtab shiftwidth=2 softtabstop=2  shiftround
+let b:under_ftplugin = "setlocal expandtab< shiftwidth< softtabstop< shiftround<"
diff --git a/.vim/vimrc b/.vim/vimrc
new file mode 100644
index 0000000..c42d0c1
--- /dev/null
+++ b/.vim/vimrc
@@ -0,0 +1,85 @@
+colorscheme desert
+
+let mapleader=" "
+set visualbell
+set laststatus=2
+set ruler
+
+" use 4-wide hard tabs by default
+set autoindent
+set shiftwidth=4
+set tabstop=4
+
+" enable filetype settings
+filetype plugin indent on
+syntax on 
+set smartindent
+
+" line wrapping
+set wrap
+set breakindent
+" scroll by visual lines without breaking <count>(j|k)
+" <http://reddit.com/r/vim/comments/2k4cbr/problem_with_gj_and_gk/cliuz1o/>
+nnoremap <expr> j v:count?'j':'gj'
+nnoremap <expr> k v:count?'k':'gk'
+vnoremap <expr> j v:count?'j':'gj'
+vnoremap <expr> k v:count?'k':'gk'
+
+" command line tab completion
+set wildmenu
+set wildignorecase
+
+" search settings
+set ignorecase
+set smartcase
+set incsearch
+set wrapscan
+" highlight on search, clear on redraw
+set hlsearch
+nnoremap <silent> <C-L> :nohl<CR><C-L>
+" center screen when going to next or previous match
+nnoremap <silent> n nzz
+nnoremap <silent> N Nzz
+
+" adjustments to other builtin commands
+set tildeop
+set whichwrap=b,s,<,>,[,]
+
+" setup whitespace display but leave it off
+set listchars=eol:$,tab:→\ ,space:·
+set nolist
+
+" open new files in insert mode
+autocmd BufNewFile * startinsert
+
+" easier access to escape
+inoremap jj <ESC>
+
+" window splitting
+nnoremap <leader>s :vsplit<CR><C-W>l
+nnoremap <leader>h <C-W>h
+nnoremap <leader>j <C-W>j
+nnoremap <leader>k <C-W>k
+nnoremap <leader>l <C-W>l
+
+" format json with =j <https://coderwall.com/p/faceag/format-json-in-vim>
+nnoremap =j :%!python -m json.tool<CR>
+
+" sudo write with w!! <https://stackoverflow.com/a/48237738>
+cnoremap w!! execute 'silent! write !sudo /usr/bin/tee % >/dev/null' <bar> edit!
+
+" windows settings
+if has('win64') || has('win32unix')
+	" yank to system clipboard
+	set clipboard=unnamed
+
+	" prefer unix format for new files even on windows machines
+	set fileformats=unix,dos
+
+	" fix cursor in conemu
+	if !empty($ConEmuBuild)
+		let &t_SI="\e[6 q" " insert mode line
+		let &t_EI="\e[2 q" " normal mode block
+		let &t_SR="\e[4 q" " replace mode underscore
+	endif
+endif