Commit 374fdfb4 authored by Dustin L. Howett's avatar Dustin L. Howett

update config with things i've been using lately

mouse=a
nornu
fix devroot
sgr mouse mode
ripgrep
jumper
move bells up to global config
conpty
parent fa535b28
......@@ -27,16 +27,20 @@
set term=$TERM " Make arrow and other keys work
endif
if has('win32') && has('terminal')
set termwintype=conpty
endif
filetype plugin indent on " Automatically detect file types.
syntax on " syntax highlighting
set mouse= " no mouse ever
set mouse=a " terminals are GUIs now, enable mouse
"set autochdir " always switch to the current file directory.. Messes with some plugins, best left commented out
" not every vim is compiled with this, use the following line instead
" If you use command-t plugin, it conflicts with this, comment it out.
"autocmd BufEnter * if bufname("") !~ "^\[A-Za-z0-9\]*://" | lcd %:p:h | endif
"autocmd BufEnter * if bufname("") !~ "^\[A-Za-z0-9\]*://" | lcd %:p:h | endif
scriptencoding utf-8
if has('x') && has('gui')
if has('unnamedplus')
set clipboard=unnamedplus
elseif has('gui')
set clipboard=unnamed
......@@ -60,7 +64,7 @@
set modeline
set modelines=2
"set spell " spell checking on
if has("persistent_undo")
set undofile " persistent undo!
set undolevels=1000
......@@ -116,14 +120,14 @@
set statusline+=%=%-14.(%l,%c%V%)\ %p%% " Right aligned file nav info
endif
set backspace=indent,eol,start " backspace for dummys
set backspace=indent,eol,start " backspace for dummys
set linespace=0 " No extra spaces between rows
set nu " Line numbers
set rnu " Line numbers relative
"set rnu " Line numbers relative
"set showmatch " show matching brackets/parenthesis
set incsearch " find as you type search
set hlsearch " highlight search terms
set winminheight=0 " windows can be 0 line high
set winminheight=0 " windows can be 0 line high
"set ignorecase " case insensitive search
set smartcase " case sensitive when uc present
set wildmenu " show list instead of just completing
......@@ -135,16 +139,17 @@
set foldenable " auto fold code
"set gdefault " the /g flag on :s substitutions by default
set completeopt-=preview " do not preview completions by default
set noeb vb t_vb= " Kill the incessant belling.
" }
" Formatting {
set nowrap " wrap long lines
set nowrap " don't wrap long lines
set autoindent " indent at the same level of the previous line
set shiftwidth=8 " use indents of 4 spaces
set noexpandtab " tabs are tabs, not spaces
set tabstop=8 " an indentation every eight columns
"set matchpairs+=<:> " match, to be used with %
set shiftwidth=8 " use indents of 8 spaces...
set noexpandtab " ...which are stored as tabs...
set tabstop=8 " ...which are every 8 columns
"set matchpairs+=<:> " match, to be used with %
set pastetoggle=<F12> " pastetoggle (sane indentation on pastes)
"set comments=sl:/*,mb:*,elx:*/ " auto format comment blocks
" Remove trailing whitespaces and ^M chars
......@@ -156,11 +161,11 @@
"The default leader is '\', but many people prefer ',' as it's in a standard
"location
"let mapleader = ','
" The following two lines conflict with moving to top and bottom of the
" screen
" If you prefer that functionality, comment them out.
"map <S-H> gT
"map <S-H> gT
"map <S-L> gt
" Stupid shift key fixes
......@@ -172,7 +177,7 @@
" Yank from the cursor to the end of the line, to be consistent with C and D.
nnoremap Y y$
""" Code folding options
nmap <leader>f0 :set foldlevel=0<CR>
nmap <leader>f1 :set foldlevel=1<CR>
......@@ -192,7 +197,7 @@
" visual shifting (does not exit Visual mode)
vnoremap < <gv
vnoremap > >gv
vnoremap > >gv
" Fix home and end keybindings for screen, particularly on mac
" - for some reason this fixes the arrow keys too. huh.
......@@ -200,7 +205,7 @@
imap <Esc>[F $
map <Esc>[H g0
imap <Esc>[H g0
" For when you forget to sudo.. Really Write the file.
cmap w!! w !sudo tee % >/dev/null
......@@ -219,19 +224,19 @@
" VCSCommand {
" let b:VCSCommandMapPrefix=',v'
" let b:VCSCommandVCSType='git'
" }
" }
" PIV {
"let g:DisableAutoPHPFolding = 0
"let cfu=phpcomplete#CompletePHP
" }
" Supertab {
"let g:SuperTabDefaultCompletionType = "context"
"let g:SuperTabContextDefaultCompletionType = "<c-x><c-o>"
" }
" Misc {
" Misc {
":map <C-F10> <Esc>:vsp<CR>:VTree<CR>
" map Control + F10 to Vtree
......@@ -245,7 +250,7 @@
"let b:match_ignorecase = 1
" }
" ShowMarks {
let showmarks_include = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
" Enable by default, use :ShowMarksOff to disable
......@@ -261,7 +266,7 @@
" Bind
nmap <Silent> <Leader>mt :ShowMarksToggle<CR>
" }
" Command-t {
"let g:CommandTSearchPath = $HOME . '/Code'
" }
......@@ -284,7 +289,7 @@
"hi PmenuSbar guifg=#8A95A7 guibg=#F8F8F8 gui=NONE ctermfg=darkcyan ctermbg=lightgray cterm=NONE
"hi PmenuThumb guifg=#F8F8F8 guibg=#8A95A7 gui=NONE ctermfg=lightgray ctermbg=darkcyan cterm=NONE
" some convenient mappings
" some convenient mappings
"inoremap <expr> <Esc> pumvisible() ? "\<C-e>" : "\<Esc>"
"inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
"inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
......@@ -294,12 +299,12 @@
" and make sure that it doesn't break supertab
"let g:SuperTabCrMapping = 0
" automatically open and close the popup menu / preview window
"au CursorMovedI,InsertLeave * if pumvisible() == 0|silent! pclose|endif
"set completeopt=menu,preview,longest
" }
" Ctags {
set tags=./tags;/,~/.vimtags
" }
......@@ -314,7 +319,7 @@
" If using html auto complete (complete closing tag)
au FileType xml,html,xhtml let b:delimitMate_matchpairs = "(:),[:],{:}"
" }
" AutoCloseTag {
" Make it so AutoCloseTag works for xml and xhtml files as well
"au FileType xhtml,xml ru ftplugin/html/autoclosetag.vim
......@@ -371,11 +376,11 @@
"nmap <leader>sl :SessionList<CR>
"nmap <leader>ss :SessionSave<CR>
" }
" Buffer explorer {
"nmap <leader>b :BufExplorer<CR>
" }
" VCS commands {
"nmap <leader>vs :VCSStatus<CR>
"nmap <leader>vc :VCSCommit<CR>
......@@ -389,7 +394,7 @@
"nmap <leader>pd :call PhpDocSingle()<CR>
"vmap <leader>pd :call PhpDocRange()<CR>
" }
" Debugging with VimDebugger {
"map <F11> :DbgStepInto<CR>
"map <F10> :DbgStepOver<CR>
......@@ -474,7 +479,7 @@
\ 'ctagsargs' : '-sort -silent'
\ }
" }
" Tagbar {
nmap <Leader>t :TagbarToggle<cr>
let g:tagbar_type_markdown = {
......@@ -526,11 +531,23 @@
let g:cpp_class_scope_highlight = 1
let g:cpp_experimental_template_highlight = 1
" }
" vim-markdown {
let g:markdown_fenced_languages = ['bash=sh', 'c', 'cpp', 'objc', 'go']
" }
" ripgrep integration {
if executable("rg")
set grepprg=rg\ --vimgrep\ --no-heading
set grepformat=%f:%l:%c:%m,%f:%l:%m
endif
" }
" jumper {
nmap <silent> <M-Left> <Plug>(jumper-prev)
nmap <silent> <M-Right> <Plug>(jumper-next)
" }
" }
......@@ -542,21 +559,20 @@
set guioptions-=r " no right scroll
set guioptions-=L " no left scroll
set lines=40 " 40 lines of text instead of 24,
set noeb vb t_vb= " Kill the incessant belling.
autocmd GUIEnter * set vb t_vb=
endif
" }
function! InitializeDirectories() " {
let separator = "."
let parent = $HOME
let parent = $HOME
let prefix = '.vim/cruft/'
if has('win32')
let prefix = 'vimfiles/cruft/'
endif
let dir_list = {
\ 'backup': 'backupdir',
\ 'views': 'viewdir',
let dir_list = {
\ 'backup': 'backupdir',
\ 'views': 'viewdir',
\ 'swap': 'directory' }
if has("persistent_undo")
......@@ -573,7 +589,7 @@ function! InitializeDirectories() " {
if !isdirectory(directory)
echo "Warning: Unable to create backup directory: " . directory
echo "Try: mkdir -p " . directory
else
else
let directory = substitute(directory, " ", "\\\\ ", "")
exec "set " . settingname . "=" . directory
endif
......@@ -593,18 +609,6 @@ function! NERDTreeInitAsNeeded() " {
endif
endfunction " }
" Use local vimrc if available {
if filereadable(expand("~/.vimrc.local"))
source ~/.vimrc.local
endif
" }
" Use DEVroot vimrc if available {
if filereadable(expand($DEV."/.vimrc"))
source $DEV/.vimrc
endif
" }
" { xterm bracketed paste support
if &term =~ "xterm.*"
let &t_ti = &t_ti . "\e[?2004h"
......@@ -621,3 +625,21 @@ if &term =~ "xterm.*"
endif
" }
" { termguicolors, SGR mouse mode for xterm
if &term =~ "xterm-.*color"
set termguicolors
set ttymouse=sgr
endif
" }
" Use local vimrc if available {
if filereadable(expand("~/.vimrc.local"))
source ~/.vimrc.local
endif
" }
" Use DEVroot vimrc if available {
if getenv('DEV') != v:null && filereadable($DEV."/.vimrc")
source $DEV/.vimrc
endif
" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment