From 19c591315da3c2488f3b00a6b4003387c1c71490 Mon Sep 17 00:00:00 2001 From: Starfall Date: Sat, 18 Jul 2020 14:18:21 -0500 Subject: vim: restore old config --- .vim/ftplugin/yaml.vim | 2 ++ .vim/vimrc | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 .vim/ftplugin/yaml.vim create mode 100644 .vim/vimrc (limited to '.vim') 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 (j|k) +" +nnoremap j v:count?'j':'gj' +nnoremap k v:count?'k':'gk' +vnoremap j v:count?'j':'gj' +vnoremap 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 :nohl +" center screen when going to next or previous match +nnoremap n nzz +nnoremap 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 + +" window splitting +nnoremap s :vsplitl +nnoremap h h +nnoremap j j +nnoremap k k +nnoremap l l + +" format json with =j +nnoremap =j :%!python -m json.tool + +" sudo write with w!! +cnoremap w!! execute 'silent! write !sudo /usr/bin/tee % >/dev/null' 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 -- cgit