Created
July 30, 2023 14:35
-
-
Save ajgappmark/e3c52286a3a8e28f352a3b789c4474fb to your computer and use it in GitHub Desktop.
my vimrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Tips/Notes----------------------------------------- | |
" Reload vimrc while editing - :so % | |
" | |
" | |
" | |
set nocompatible " be iMproved, required | |
filetype off " required | |
" 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' | |
"Plugins--------------------------------------------- | |
"Installation :PluginInstall | |
Plugin 'tpope/vim-fugitive' | |
Plugin 'vim-airline/vim-airline' | |
Plugin 'vim-airline/vim-airline-themes' | |
Plugin 'rafi/awesome-vim-colorschemes' | |
Plugin 'scrooloose/nerdtree' | |
Plugin 'fatih/vim-go' | |
Plugin 'kien/ctrlp.vim' | |
Plugin 'scrooloose/syntastic' | |
Plugin 'tpope/vim-abolish' | |
Plugin 'vim-scripts/taglist.vim' | |
Plugin 'jlanzarotta/bufexplorer' | |
Plugin 'godlygeek/tabular' | |
Plugin 'junegunn/goyo.vim' | |
Plugin 'MarcWeber/vim-addon-mw-utils' | |
Plugin 'tomtom/tlib_vim' | |
Plugin 'garbas/vim-snipmate' | |
Plugin 'honza/vim-snippets' | |
Plugin 'mileszs/ack.vim' | |
Plugin 'lervag/vimtex' | |
Plugin 'vim-scripts/pic.vim' | |
Plugin 'vim-latex/vim-latex' | |
Plugin 'vim-scripts/loremipsum' | |
Plugin 'artanikin/vim-synthwave84' | |
Plugin 'jnurmine/Zenburn' | |
Plugin 'sjbach/lusty' | |
"Plugin 'mswift42/vim-themes' | |
"Plugin 'wincent/command-t' "fuzzy file searcher | |
call vundle#end() " required | |
"OtherSettings-------------------------------------- | |
filetype plugin indent on " required | |
"leader | |
let mapleader ="\\" "usually , is preferred, but \ is default | |
let maplocalleader="\<space>" | |
"======DougBlack's Adaptation======================= | |
" Colors {{{ | |
syntax enable " enable syntax processing | |
colorscheme onedark | |
"Preffered: OceanicNext, solarized8, alduin, atom, ayu, github, gruvbox | |
"Simple: Paramount | |
"Adapting: gotham, iceberg, (bgc customized) onedark, synthwave84 | |
let g:airline_theme='luna' "raven base16_brewer, violet, lucius, bubblegum, distinguised, gotham | |
" }}} | |
" Misc {{{ | |
set backspace=indent,eol,start | |
set clipboard=unnamedplus " systemclipboard (unnamed: windows, unnamedplus: linux) | |
set ttimeoutlen=50 " fix normal/insert mode switching delay | |
set paste " keep indentation during paste | |
set nocompatible | |
set hidden "enabled for lusty explorer | |
" for vim 7 | |
set t_Co=256 | |
" for vim 8 | |
if (has("termguicolors")) | |
set termguicolors | |
endif | |
let g:solarized_italics=0 | |
" }}} | |
" Spaces & Tabs {{{ | |
set tabstop=4 " 4 space tab | |
set expandtab " use spaces for tabs | |
set softtabstop=4 " 4 space tab | |
set shiftwidth=4 | |
set modelines=1 | |
set nopaste "disable garbled indentation on paste from system clipboard | |
filetype indent on | |
filetype plugin on | |
set autoindent | |
" }}} | |
" UI Layout {{{ | |
set number " show line numbers | |
set showcmd " show command in bottom bar | |
set cursorline " highlight current line; (nocursorline) | |
set wildmenu | |
set lazyredraw | |
set showmatch " higlight matching parenthesis | |
set fillchars+=vert:┃ | |
" Splits open at the bottom and right, which is non-retarded, unlike vim defaults. | |
set splitbelow splitright | |
" gvim specific settings | |
if has('gui_running') | |
colorscheme afterglow "abstract Paperclip afterglow ayu carbonizeddark challengerdeep *deus *flattenedligth | |
"gruvbox hybridreverse industry *lightning lucius materialbox meta5 *morning pablo | |
"parsec 'peachpuff pinkmoon | |
set guifont=Monaco\ 12 | |
set guioptions -=T | |
endif | |
set mouse-=a " disable mouse selection leading to visual mode | |
" }}} | |
" Shortcuts and Mappings {{{ | |
map <F5> :NERDTreeToggle<CR> | |
map <F6> :Tlist<CR> | |
"set pastetoggle=<F2> | |
"nnoremap <esc> :noh<return><esc> | |
" tab navigation | |
"nnoremap <C-Left> :tabprevious<CR> | |
"nnoremap <C-Right> :tabnext<CR> | |
nnoremap <C-j> :tabprevious<CR> | |
nnoremap <C-k> :tabnext<CR> | |
" Map Ctrl-A -> Start of line, Ctrl-E -> End of line | |
map <C-a> <Home> | |
map <C-e> <End> | |
" move lines up/down | |
"inoremap <A-j> <Esc>:m .+1<CR>==gi | |
"inoremap <A-k> <Esc>:m .-2<CR>==gi | |
"vnoremap <A-j> :m '>+1<CR>gv=gv | |
"vnoremap <A-k> :m '<-2<CR>gv=gv | |
" Goyo plugin makes text more readable when writing prose: | |
map <leader>f :Goyo \| set bg=light \| set linebreak<CR> | |
" Spell-check set to <leader>o, 'o' for 'orthography': | |
map <leader>o :setlocal spell! spelllang=en_us<CR> | |
" custom filespecific keybindings | |
" source $HOME/Dropbox/dxshare/dotfiles/vim/vim-filespecific-keybinds | |
" quickly edit .vimrc in new tab | |
nmap <leader>ev :tabedit $MYVIMRC<cr> | |
" turn off highlight | |
nmap <leader><space> :nohlsearch<cr> | |
" d for delete, leader d for cut | |
"nnoremap x "_x | |
"nnoremap d "_d | |
"nnoremap D "_D | |
"vnoremap d "_d | |
"nnoremap <leader>d ""d | |
"nnoremap <leader>D ""D | |
"vnoremap <leader>d ""d | |
" }}} | |
" Searching {{{ | |
set ignorecase " ignore case when searching | |
set incsearch " search as characters are entered | |
set hlsearch " highlight all matches | |
" }}} | |
" Folding {{{ | |
"=== folding === | |
set foldmethod=indent " fold based on indent level | |
set foldnestmax=10 " max 10 depth | |
set foldenable " don't fold files by default on open | |
nnoremap <space> za | |
set foldlevelstart=10 " start with fold level of 1 | |
" }}} | |
" Custom Functions {{{ | |
function! <SID>ToggleNumber() | |
if(&relativenumber == 1) | |
set norelativenumber | |
set number | |
else | |
set relativenumber | |
endif | |
endfunc | |
" strips trailing whitespace at the end of files. this | |
" is called on buffer write in the autogroup above. | |
function! <SID>StripTrailingWhitespaces() | |
" save last search & cursor position | |
let _s=@/ | |
let l = line(".") | |
let c = col(".") | |
%s/\s\+$//e | |
let @/=_s | |
call cursor(l, c) | |
endfunc | |
function! <SID>CleanFile() | |
" Preparation: save last search, and cursor position. | |
let _s=@/ | |
let l = line(".") | |
let c = col(".") | |
" Do the business: | |
%!git stripspace | |
" Clean up: restore previous search history, and cursor position | |
let @/=_s | |
call cursor(l, c) | |
endfunc | |
function! <SID>RunFile() | |
let ext = expand("%:e") | |
if(ext == "go") | |
:GoRun | |
endif | |
endfunc | |
function! <SID>BuildFile() | |
let ext = expand("%:e") | |
if(ext == "go") | |
:GoBuild | |
endif | |
endfunc | |
" }}} | |
" Plugin Specifics {{{ | |
"-- Airline | |
let g:airline#extensions#tabline#enabled = 1 | |
"--NerdTree | |
" Open NERDTree when vim opens a directory | |
autocmd StdinReadPre * let s:std_in=1 | |
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif | |
"let NERDTreeMapOpenInTab='<ENTER>' "open files in new tab | |
"--vim-go | |
let g:go_version_warning = 0 | |
"Tlist | |
let Tlist_Use_Right_Window= 1 | |
"--Snippets | |
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe. | |
"let g:UltiSnipsExpandTrigger="<tab>" | |
"let g:UltiSnipsJumpForwardTrigger="<c-b>" | |
"let g:UltiSnipsJumpBackwardTrigger="<c-z>" | |
"let g:UltiSnipsEditSplit="vertical" | |
"let g:UltiSnipsSnippetDirectories=["~/.vim/bundle/vim-snippets/snippets", "~/Dropbox/dxshare/dotfiles/vim/ultisnips-user"] | |
"--latex, otherwise vim open tex files as plaintex | |
let g:tex_flavor = "latex" | |
let g:Tex_DefaultTargetFormat = "pdf" | |
let g:Tex_CompileRule_pdf = "pdflatex --interaction=nonstopmode S* " | |
"--suppress vim ruby warning | |
let g:LustyJugglerSuppressRubyWarning = 1 | |
"--ignore snipmate legacy parser warning | |
let g:snipMate = { 'snippet_version' : 1 } | |
" }}} | |
" vim:foldmethod=marker:foldlevel=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment