Skip to content

Instantly share code, notes, and snippets.

@stonecharioteer
Last active May 24, 2020 09:58
Show Gist options
  • Save stonecharioteer/8ec324a64e090960fff1804ba6170c8a to your computer and use it in GitHub Desktop.
Save stonecharioteer/8ec324a64e090960fff1804ba6170c8a to your computer and use it in GitHub Desktop.
dotfiles
" set leader to `,`
let mapleader = ","
" turn on line numbers
set number
" enable syntax highlighting
syntax on
" enable ruler
set ruler
" highlight search
set hls
" Set tabs to 4 spaces
set tabstop=4
set softtabstop=4
set expandtab
set cursorline
filetype indent on
set wildmenu
set lazyredraw
set showmatch
set incsearch
nnoremap <leader>s :nohlsearch<CR>
set foldenable
set foldlevelstart=10
set foldnestmax=10
noremap <space> za
set foldmethod=indent
" set whitespace characters
" set listchars=eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣
" set list
set listchars=tab:->,space:·
nnoremap <leader><space> :set list!<CR>
" nnoremap j gj
" noremap k gk
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()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
"Plugin 'https://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
" Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}
Plugin 'davidhalter/jedi-vim'
Plugin 'preservim/nerdtree'
Plugin 'airblade/vim-gitgutter'
Plugin 'vim-airline/vim-airline'
Plugin 'scrooloose/nerdcommenter'
Plugin 'honza/vim-snippets'
Plugin 'junegunn/fzf'
Plugin 'junegunn/fzf.vim'
Plugin 'gilsondev/searchtasks.vim'
Plugin 'irrationalistic/vim-tasks'
Plugin 'easymotion/vim-easymotion'
Plugin 'rainglow/vim'
Plugin 'yggdroot/indentline'
Plugin 'ntpeters/vim-better-whitespace'
Plugin 'craigemery/vim-autotag'
Plugin 'Valloric/YouCompleteMe'
Plugin 'vim-syntastic/syntastic'
Plugin 'nvie/vim-flake8'
Plugin 'kien/ctrlp.vim'
Plugin 'mhinz/vim-startify'
Plugin 'apzelos/blamer.nvim'
Plugin 'dart-lang/dart-vim-plugin'
Plugin 'natebosch/vim-lsc'
Plugin 'natebosch/vim-lsc-dart'
Plugin 'rust-lang/rust.vim'
Plugin 'tpope/vim-commentary'
Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown' " Ensure tabular is imported before.
Plugin 'christoomey/vim-tmux-navigator'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
nnoremap <C-n> :NERDTreeToggle<CR>
" autocmd StdinReadPre * let s:std_in=1
" autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
" Remap movements
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" use natural splits
set splitbelow
set splitright
" <Leader>f{char} to move to {char}
noremap <Leader>f <Plug>(easymotion-bd-f)
nnoremap <Leader>f <Plug>(easymotion-overwin-f)
" s{char}{char} to move to {char}{char}
nnoremap s <Plug>(easymotion-overwin-f2)
" Move to line
noremap <Leader>L <Plug>(easymotion-bd-jk)
nnoremap <Leader>L <Plug>(easymotion-overwin-line)
" Move to word
noremap <Leader>w <Plug>(easymotion-bd-w)
nnoremap <Leader>w <Plug>(easymotion-overwin-w)
" split screens
nnoremap <leader>\| :vsplit<CR>
nnoremap <leader>- :split<CR>
" open vimrc easily
nnoremap <leader>ev :vsplit $MYVIMRC<cr>
" source vimrc
nnoremap <leader>sv :source $MYVIMRC<cr>
" disable arrow keys
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
" inoremap <esc> <nop>
" inoremap jk <esc>
" noremap <leader>h <ctrl>wh
" noremap <leader>j <ctrl>wj
" noremap <leader>k <ctrl>wk
" noremap <leader>l <ctrl>wl
"
hi CursorLine ctermbg=darkred ctermfg=white guibg=darkred guifg=white
hi CursorColumn ctermbg=darkred ctermfg=white guibg=darkred guifg=white
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" fix python indentation
au BufNewFile,BufRead *.py
\ set tabstop=4
\ set softtabstop=4
\ set shiftwidth=4
\ set textwidth=79
\ set expandtab
\ set autoindent
\ set fileformat=unix
au BufNewFile,BufRead *.js, *.html, *.css
\ set tabstop=2
\ set softtabstop=2
\ set shiftwidth=2
" au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
set encoding=utf-8
let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
let g:python3_host_prog = '/home/vinay/.nvimenv/bin/python3'
let g:loaded_python_provider = 0
" python with virtualenv support
let python_highlight_all=1
syntax on
let NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
set guifont=Hermit\ Medium:h14
"set guifont=Menlo\ Regular:h14
nmap <leader>L <C-w>L
nmap <leader>H <C-w>H
nmap <leader>J <C-w>J
nmap <leader>K <C-w>K
py3 << EOF
import os
import sys
if 'VIRTUAL_ENV' in os.environ:
project_base_dir = os.environ['VIRTUAL_ENV']
activate_this = os.path.join(project_base_dir, 'bin/activate')
os.system(activate_this)
# exec(activate_this, dict(__file__=activate_this))
EOF
unbind C-b
bind-key C-a send prefix
set-option -g prefix C-a
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
setw -g mode-keys vi
#setw -g mode-mouse on # tmux -V < 2.1
setw -g mouse on
setw -g monitor-activity on
bind-key | split-window -h
bind-key - split-window -v
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key H resize-pane -L 5
bind-key L resize-pane -R 5
bind-key M-j resize-pane -D
bind-key M-k resize-pane -U
bind-key M-h resize-pane -L
bind-key M-l resize-pane -R
# Vim style pane selection
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Use Alt-vim keys without prefix key to switch panes
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# No delay for escape key press
set -sg escape-time 0
# Reload tmux config
bind r source-file ~/.tmux.conf
# THEME
set -g status-bg black
set -g status-fg white
set -g window-status-current-bg white
set -g window-status-current-fg black
set -g window-status-current-attr bold
set -g status-interval 60
set -g status-left-length 30
set -g status-left '#[fg=green](#S) #(whoami)'
set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l
{
"python.poetryPath": "/home/vinay/.poetry/bin/poetry",
"python.linting.pylintEnabled": true,
"python.linting.pylamaEnabled": false,
"python.linting.flake8Enabled": false,
"python.linting.pydocstyleEnabled": false,
"workbench.sideBar.location": "right",
"python.formatting.provider": "black",
"python.analysis.disabled": [
"inherit-non-class"
],
"workbench.iconTheme": "vscode-icons",
"python.jediEnabled": false,
"window.zoomLevel": 1,
"terminal.integrated.fontFamily": "Hack",
"files.trimFinalNewlines": true,
"editor.rulers": [
78,
100
],
"emmet.includeLanguages": {"django-html": "html"},
"editor.minimap.enabled": false,
"editor.renderWhitespace": "all",
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"breadcrumbs.enabled": true,
"workbench.colorCustomizations": {
"tab.activeBackground": "#48f4",
"editor.lineHighlightBorder": "#2e2ea5",
"editor.lineHighlightBackground": "#00f3",
"tab.hoverBackground": "#0805",
"tab.activeBorder": "#ff0000",
"statusBar.background": "#8FBCBB",
"statusBar.noFolderBackground": "#8FBCBB",
"statusBar.debuggingBackground": "#8FBCBB",
"statusBar.foreground": "#434C5E"
},
"window.titleBarStyle": "custom",
"workbench.activityBar.visible": true,
"editor.mouseWheelZoom": true,
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true,
"**/env/**": true,
},
"vsicons.dontShowNewVersionMessage": true,
"todo.timekeeping.created.enabled": true,
"todo.archive.project.separator": ".",
"todo.statistics.project.enabled": "global.projects < 100 && project.all > 0",
"todo.archive.name": "Archive",
"python.condaPath": "/home/vinay/miniconda3/bin/conda",
"python.pipenvPath": "/home/vinay/miniconda3/bin/pipenv",
"vim.easymotion": true,
"vim.sneak": true,
"vim.incsearch": true,
"vim.useSystemClipboard": true,
"vim.useCtrlKeys": true,
"vim.hlsearch": true,
"vim.insertModeKeyBindings": [
{
"before": ["j", "j"],
"after": ["<Esc>"]
}
],
"vim.normalModeKeyBindingsNonRecursive": [
{
"before": ["<leader>", "d"],
"after": ["d", "d"]
},
{
"before": ["<C-n>"],
"commands": [":nohl"]
}
],
"vim.leader": "<space>",
"vim.handleKeys": {
"<C-a>": false,
"<C-f>": false,
"<C-c>": false,
"<C-s>": false,
"<C-b>": false,
"<C-k>": false,
"<C-w>": false,
"<C-[>": false,
"<C-]>": false,
"<C-n>": false,
"<C-x>": false,
"<C-v>": false,
"<C-d>": false,
// "<C-shift-"
},
"vim.statusBarColorControl": true,
"vim.statusBarColors.normal": ["#8FBCBB", "#434C5E"],
"vim.statusBarColors.insert": "#BF616A",
"vim.statusBarColors.visual": "#B48EAD",
"vim.statusBarColors.visualline": "#B48EAD",
"vim.statusBarColors.visualblock": "#A3BE8C",
"vim.statusBarColors.replace": "#D08770",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"workbench.statusBar.visible": true,
"polacode.shadow": false,
"better-comments.highlightPlainText": true,
"files.exclude": {
"**/env": true
},
"terminal.integrated.inheritEnv": true,
"markdown.preview.fontSize": 18,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment