Skip to content

Instantly share code, notes, and snippets.

@AndrewWCarson
Created November 12, 2019 20:32
Show Gist options
  • Save AndrewWCarson/e63f458a3170300807e2879c69639bb2 to your computer and use it in GitHub Desktop.
Save AndrewWCarson/e63f458a3170300807e2879c69639bb2 to your computer and use it in GitHub Desktop.
vim settings and such....
" Andrew Worth Carson
" (C) 2017
" Rebind <Leader> key
let mapleader = ","
" Rebind copy & paste
vmap <Leader>c :w !pbcopy<CR>
" Bind quicksave commands
noremap <Leader>w :update<CR>
noremap <Leader>W :wq<CR>
" Bind quit commands
noremap <Leader>q :quit<CR>
noremap <Leader>Q :qa!<CR>
" Bind Escape to backtick
imap ` <Esc>
" Bind Ctrl+<movement> keys to move around the windows, instead of using Ctrl+w + <movement>
" Every unnecessary keystroke that can be saved is good for your health :)
" map <c-j> <c-w>j
" map <c-k> <c-w>k
" map <c-l> <c-w>l
" map <c-h> <c-w>h
" Bind quick tab commands
map <Leader>n <esc>:tabprevious<CR>
map <Leader>m <esc>:tabnext<CR>
" Bind sort function
"" vnoremap <Leader>s :sort<CR>
" Indentation
set expandtab
set autoindent
set tabstop=4
set shiftwidth=4
" Binding easier indentation of code blocks
vnoremap < <gv
vnoremap > >gv
" Show whitespace
" MUST be inserted BEFORE the colorscheme command
"" autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
"" au InsertLeave * match ExtraWhitespace /\s\+$/
" Color scheme
" colorscheme dracula
" Enable syntax highlighting
syntax enable
" Showing line numbers and length
set number " show line numbers
set tw=79 " width of document (used by gd)
set nowrap " don't automatically wrap on load
set formatoptions-=t " don't automatically wrap text when typing
set colorcolumn=80
" easier formatting of paragraphs
"" vmap Q gq
"" nmap Q gqap
" Setting length of history
set history=700
set undolevels=700
" Disable backup and swap files
set nobackup
set nowritebackup
set noswapfile
" Set multiple file arguments to automatically open in tabs
tab all
" Setup Pathogen to manage plugins
" mkdir -p ~/.vim/autoload ~/.vim/bundle
" curl -so ~/.vim/autoload/pathogen.vim https://raw.githubusercontent.com/tpope/vim-pathogen/master/autoload/pathogen.vim
" Install any plugin into a .vim/bundle/plugin-name/ folder
call pathogen#infect()
call pathogen#helptags()
" Installing vim-omnisharp as C# IDE
" cd ~/.vim/bundle
" git clone https://github.com/OmniSharp/omnisharp-vim.git
" cd omnisharp-vim
" git submodule update --init --recursive
" cd server
" xbuild
" Settings for vim-powerline
" cd ~/.vim/bundle
" git clone git://github.com/Lokaltog/vim-powerline.git
"" set laststatus=2
" Settings for ctrlp
" cd ~/.vim/bundle
" git clone https://github.com/kien/ctrlp.vim.git
"" let g:ctrlp_max_height = 30
"" set wildignore+=*.pyc
"" set wildignore+=*_build/*
"" set wildignore+=*/coverage/*
" Better navigating through omnicomplete option list
" See http://stackoverflow.com/questions/2170023/how-to-map-keys-for-popup-menu-in-vim
"" set completeopt=longest,menuone
"" function! OmniPopup(action)
"" if pumvisible()
"" if a:action == 'j'
"" return "\<C-N>"
"" elseif a:action == 'k'
"" return "\<C-P>"
"" endif
"" endif
"" return a:action
"" endfunction
"" inoremap <silent><C-j> <C-R>=OmniPopup('j')<CR>
"" inoremap <silent><C-k> <C-R>=OmniPopup('k')<CR>
" Python folding
" mkdir -p ~/.vim/ftplugin
" wget -O ~/.vim/ftplugin/python_editing.vim http://www.vim.org/scripts/download_script.php?src_id=5492
"" set nofoldenable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment