-
-
Save chkilel/3d2f58d26fd27e6047ac01de8252db76 to your computer and use it in GitHub Desktop.
my terminal settings for windows (babun - http://babun.github.io/) curl https://gist.githubusercontent.com/prabirshrestha/279d8b179d9353fe8694/raw/babun-post-install | zsh
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
Font=Powerline Consolas | |
ForegroundColour=131,148,150 | |
BackgroundColour=0,43,54 | |
CursorColour=220,50,47 | |
Black=7,54,66 | |
BoldBlack=0,43,54 | |
Red=220,50,47 | |
BoldRed=203,75,22 | |
Green=133,153,0 | |
BoldGreen=88,110,117 | |
Yellow=181,137,0 | |
BoldYellow=101,123,131 | |
Blue=38,139,210 | |
BoldBlue=131,148,150 | |
Magenta=211,54,130 | |
BoldMagenta=108,113,196 | |
Cyan=42,161,152 | |
BoldCyan=147,161,161 | |
White=238,232,213 | |
BoldWhite=253,246,227 | |
Transparency=low | |
FontHeight=12 | |
Scrollbar=none |
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
# curl https://gist.githubusercontent.com/prabirshrestha/279d8b179d9353fe8694/raw/.tmux.conf -o ~/.tmux.conf | |
bind r source-file ~/.tmux.conf \; display "Reloaded!" | |
# Change the prefix to Ctrl+a | |
unbind C-b | |
set -g prefix C-a | |
bind C-a send-prefix | |
# enable pretty colors | |
set -g default-terminal "screen-256color" | |
# increase scroll-back history | |
set -g history-limit 5000 | |
# use vim key bindings | |
setw -g mode-keys vi | |
# start window index at 1 | |
set -g base-index 1 | |
# start pane index at 1 | |
set -g pane-base-index 1 | |
# change the default delay to make it more responsive | |
set -sg escape-time 1 | |
# Splitting panes | |
bind \ split-window -h | |
bind - split-window -v | |
# pane movements | |
bind h select-pane -L | |
bind j select-pane -D | |
bind k select-pane -U | |
bind l select-pane -R | |
# pane resizing | |
bind H resize-pane -L 5 | |
bind J resize-pane -D 5 | |
bind K resize-pane -U 5 | |
bind L resize-pane -R 5 | |
# pane resizing | |
bind -r H resize-pane -L 5 | |
bind -r J resize-pane -D 5 | |
bind -r K resize-pane -U 5 | |
bind -r L resize-pane -R 5 | |
# window movement | |
bind -r C-h select-window -t:- | |
bind -r C-l select-window -t:+ | |
# remapping copy paste to vim | |
# unbind [ | |
bind Escape copy-mode | |
unbind p | |
bind p paste-buffer | |
# bind -t vi-copy 'v' begin-selection | |
# bind -t vi-copy 'y' copy-selection | |
# setw -g monitory-activity on | |
set -g visual-activity on | |
# Enable mouse support in ~/.tmux.conf | |
set -g mouse on | |
# smart pane switching with awareness of vim splits | |
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L" | |
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D" | |
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U" | |
#bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R" | |
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l" | |
set-option -g renumber-windows on | |
setw -g aggressive-resize on | |
# panes | |
set -g pane-border-fg black | |
set -g pane-active-border-fg brightred | |
## Status bar design | |
# status line | |
set -g status-justify left | |
set -g status-bg default | |
set -g status-fg colour12 | |
set -g status-interval 2 | |
# messaging | |
set -g message-fg black | |
set -g message-bg yellow | |
set -g message-command-fg blue | |
set -g message-command-bg black | |
#window mode | |
setw -g mode-bg colour6 | |
setw -g mode-fg colour0 | |
# window status | |
setw -g window-status-format " #F#I:#W#F " | |
setw -g window-status-current-format " #F#I:#W#F " | |
setw -g window-status-format "#[fg=magenta]#[bg=black] #I #[bg=cyan]#[fg=colour8] #W " | |
setw -g window-status-current-format "#[bg=brightmagenta]#[fg=colour8] #I #[fg=colour8]#[bg=colour14] #W " | |
setw -g window-status-current-bg colour0 | |
setw -g window-status-current-fg colour11 | |
setw -g window-status-current-attr dim | |
setw -g window-status-bg green | |
setw -g window-status-fg black | |
setw -g window-status-attr reverse | |
# Info on left (I don't have a session display for now) | |
set -g status-left '' | |
# loud or quiet? | |
set-option -g visual-activity off | |
set-option -g visual-bell off | |
set-option -g visual-silence off | |
set-window-option -g monitor-activity off | |
set-option -g bell-action none | |
set -g default-terminal "screen-256color" | |
# The modes { | |
setw -g clock-mode-colour colour135 | |
setw -g mode-attr bold | |
setw -g mode-fg colour196 | |
setw -g mode-bg colour238 | |
# } | |
# The panes { | |
set -g pane-border-bg colour235 | |
set -g pane-border-fg colour238 | |
set -g pane-active-border-bg colour236 | |
set -g pane-active-border-fg colour51 | |
# } | |
# The statusbar { | |
set -g status-position bottom | |
set -g status-bg colour234 | |
set -g status-fg colour137 | |
set -g status-attr dim | |
set -g status-left '' | |
set -g status-right '#[fg=colour233,bg=colour241,bold] %d/%m #[fg=colour233,bg=colour245,bold] %H:%M:%S ' | |
set -g status-right-length 50 | |
set -g status-left-length 20 | |
setw -g window-status-current-fg colour81 | |
setw -g window-status-current-bg colour238 | |
setw -g window-status-current-attr bold | |
setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F ' | |
setw -g window-status-fg colour138 | |
setw -g window-status-bg colour235 | |
setw -g window-status-attr none | |
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F ' | |
setw -g window-status-bell-attr bold | |
setw -g window-status-bell-fg colour255 | |
setw -g window-status-bell-bg colour1 | |
# } | |
# The messages { | |
set -g message-attr bold | |
set -g message-fg colour232 | |
set -g message-bg colour166 | |
# } |
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
" curl -Lk https://gist.githubusercontent.com/prabirshrestha/279d8b179d9353fe8694/raw/.vimrc -o ~/.vimrc | |
" to use existing vim configuration as neovim configuration | |
" ln -s ~/.vimrc ~/.config/nvim/init.vim | |
" For windows download lua binaries from https://sourceforge.net/projects/luabinaries/files/5.3.3/Windows%20Libraries/Dynamic/lua-5.3.3_Win64_dll11_lib.zip/download | |
set nocompatible " must be first line | |
set encoding=utf-8 | |
scriptencoding utf-8 | |
set fileformats=unix,mac,dos | |
syntax enable " Syntax highlight is On | |
filetype on " enable file type detection | |
filetype plugin on " enable loading the plugin files for specific file types | |
filetype indent on " load indent files for specific file types | |
let mapleader = ' ' | |
nnoremap ; : | |
" vimrc {{{ | |
nnoremap <leader>ev :e $MYVIMRC<cr> | |
nnoremap <leader>sv :source $MYVIMRC<cr> | |
" }}} | |
let s:settings = {} | |
let s:settings.is_win = has('win32') || has('win64') | |
if s:settings.is_win | |
set shellslash | |
endif | |
let s:is_cygwin = has('win32unix') | |
let s:is_mac = has('macunix') || (executable('uname') && system('uname') =~? '^darwin') | |
let s:settings.rtp = expand('~/.config/nvim') | |
let s:settings.cache = s:settings.rtp . '/cache' | |
let s:settings.plugins = s:settings.cache . '/plugins' | |
let s:settings.backupdir = s:settings.cache . '/backup' | |
let s:settings.swapdir = s:settings.cache . '/swap' | |
let s:settings.undodir = s:settings.cache . '/undo' | |
let s:settings.completionlib = '' | |
if has('vim_starting') | |
execute 'set rtp^=' . fnamemodify(s:settings.rtp, ':p') | |
endif | |
if !executable('curl') | |
echom 'curl required' | |
endif | |
if !executable('git') | |
echom 'git required' | |
endif | |
if !has('nvim') && has('vim_starting') | |
execute 'set rtp^=' . fnamemodify(s:settings.rtp, ':p') | |
endif | |
" {{{ functions | |
function! s:Mkdirp(dirname) | |
if !isdirectory(expand(a:dirname)) | |
call mkdir(expand(a:dirname), 'p') | |
endif | |
endfunction | |
function! s:path_escape(path) | |
if s:settings.is_win | |
return substitute(a:path, '/', '\\', 'g') | |
else | |
return a:path | |
endif | |
endfunction | |
" }}} | |
if !filereadable(s:settings.rtp . '/autoload/plug.vim') | |
execute 'silent !curl -fkLo ' . s:path_escape(s:settings.rtp . '/autoload/plug.vim') . ' --create-dirs' | |
\ ' https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' | |
autocmd VimEnter * PlugInstall | |
endif | |
call plug#begin(s:settings.plugins) | |
" Plug 'mhartington/oceanic-next' | |
Plug 'iCyMind/NeoSolarized' | |
" Plug 'altercation/vim-colors-solarized' | |
Plug 'mattn/webapi-vim' | |
if s:settings.is_win | |
Plug 'Shougo/vimproc.vim' | |
else | |
Plug 'Shougo/vimproc.vim', { 'do': 'make' } | |
endif | |
Plug 'junegunn/vader.vim' | |
Plug 'Raimondi/delimitMate' | |
Plug 'airblade/vim-rooter' | |
Plug 'DataWraith/auto_mkdir' | |
Plug 'itchyny/lightline.vim' | |
Plug 'Lokaltog/vim-easymotion' | |
Plug 'tomtom/tcomment_vim' | |
Plug 'alvan/vim-closetag' | |
if s:settings.is_win | |
Plug 'GrzegorzKozub/vimdows' | |
endif | |
Plug 'tpope/vim-repeat' | |
Plug 'tpope/vim-surround' | |
Plug 'tpope/vim-vinegar' | |
Plug 'gagoar/StripWhiteSpaces' | |
Plug 'prabirshrestha/async.vim' | |
Plug 'prabirshrestha/vim-lsp' | |
Plug 'scrooloose/nerdtree' | |
Plug 'lambdalisue/gina.vim', { 'on': 'Gina' } | |
Plug 'justinmk/vim-gtfo' | |
Plug 'sgur/vim-editorconfig' | |
Plug 'wincent/ferret' | |
if executable('fzf') | |
Plug 'junegunn/fzf' | |
Plug 'junegunn/fzf.vim' | |
Plug 'pbogut/fzf-mru.vim' | |
if s:settings.is_win | |
Plug 'prabirshrestha/fzf-session.vim', { 'branch': 'fzf-session-load-fix' } | |
else | |
Plug 'dominickng/fzf-session.vim' | |
endif | |
endif | |
Plug 'mattn/vim-fz' | |
" Plug 'ctrlpvim/ctrlp.vim' | |
" Plug 'hara/ctrlp-colorscheme', { 'on': 'CtrlPColorscheme' } | |
" Plug 'kaneshin/ctrlp-filetype', { 'on': 'CtrlPFiletype' } | |
" Plug 'mattn/ctrlp-vimpatches', { 'on': 'CtrlPVimPatches' } | |
" " Plug 'okcompute/vim-ctrlp-session' | |
" Plug 'tacahiroy/ctrlp-funky', { 'on': 'CtrlPFunky' } | |
" if has('python') || has('python3') | |
" Plug 'FelikZ/ctrlp-py-matcher' | |
" endif | |
Plug 'HerringtonDarkholme/yats.vim', { 'for': 'typescript' } | |
" Plug 'leafgarland/typescript-vim', { 'for': 'typescript' } | |
if has('python3') | |
" Plug 'SirVer/ultisnips' | |
" Plug 'honza/vim-snippets' | |
endif | |
" Plug 'w0rp/ale' | |
if 0" has('python3') && (has('nvim') || (!has('nvim') && executable('python3'))) | |
Plug 'roxma/nvim-completion-manager' | |
if !has('nvim') | |
" pip install msgpack-python | |
Plug 'roxma/vim-hug-neovim-rpc' | |
endif | |
let s:settings.completionlib = 'ncm' | |
else | |
Plug 'prabirshrestha/asyncomplete.vim' | |
Plug 'prabirshrestha/asyncomplete-lsp.vim' | |
Plug 'yami-beta/asyncomplete-omni.vim' | |
Plug 'prabirshrestha/asyncomplete-buffer.vim' | |
Plug 'Shougo/neco-syntax' | |
Plug 'prabirshrestha/asyncomplete-necosyntax.vim' | |
Plug 'Shougo/neco-vim' | |
Plug 'prabirshrestha/asyncomplete-necovim.vim' | |
Plug 'prabirshrestha/asyncomplete-gocode.vim' | |
Plug 'prabirshrestha/asyncomplete-flow.vim' | |
" if executable('ctags') | |
" Plug 'ludovicchabant/vim-gutentags' | |
" Plug 'prabirshrestha/asyncomplete-tags.vim' | |
" endif | |
" Plug 'prabirshrestha/asyncomplete-ultisnips.vim' | |
" Plug 'Shougo/neosnippet.vim' | |
" Plug 'Shougo/neosnippet-snippets' | |
" Plug 'prabirshrestha/asyncomplete-neosnippet.vim' | |
let s:settings.completionlib = 'asyncomplete' | |
" elseif has('nvim') && has('python3') | |
" Plug 'Shougo/deoplete.nvim' | |
" Plug 'mhartington/nvim-typescript' | |
" let s:settings.completionlib = 'deoplete' | |
endif | |
Plug 'fatih/vim-go', { 'for': 'go' } | |
Plug 'mhinz/vim-lookup', { 'for': 'vim' } | |
Plug 'jparise/vim-graphql' | |
if has('nvim') | |
Plug 'equalsraf/neovim-gui-shim' | |
endif | |
call plug#end() | |
call s:Mkdirp(s:settings.backupdir) | |
execute 'set backupdir=' . s:settings.backupdir | |
call s:Mkdirp(s:settings.swapdir) | |
execute 'set directory=' . s:settings.swapdir | |
call s:Mkdirp(s:settings.undodir) | |
execute 'set undodir=' . s:settings.undodir | |
set undolevels=1000 " Maximum number of changes that can be undone | |
set undoreload=10000 " Maximum number of lines to save for undo on buffer reload | |
if has('termguicolors') | |
set termguicolors | |
endif | |
set background=dark | |
if $TERM == "xterm-256color" || $TERM == "screen-256color" || $COLORTERM == "gnome-terminal" || !s:settings.is_win | |
set t_Co=256 | |
" set term=xterm | |
" disable Background Color Erase (BCE) so that color schemes | |
" render properly when inside 256-color tmux and GNU screen. | |
" see also http://snk.tuxfamily.org/log/vim-256color-bce.html | |
set t_ut= | |
endif | |
if s:settings.is_win | |
hi Comment cterm=none | |
if has('directx') | |
set renderoptions=type:directx | |
endif | |
endif | |
set termencoding=utf8 | |
if !empty($CONEMUBUILD) | |
set term=xterm | |
set t_Co=256 | |
" 256 color mode | |
let &t_AB="\e[48;5;%dm" | |
let &t_AF="\e[38;5;%dm" | |
" set codes for dynamic cursor type with vim modes | |
let &t_te="\e[0 q" | |
let &t_ti="\e[1 q" | |
let &t_EI="\e[1 q" | |
let &t_SI="\e[5 q" | |
let &t_SR="\e[3 q" | |
" fix broken backspaces | |
" inoremap <Char-0x07F> <BS> | |
" nnoremap <Char-0x07F> <BS> | |
" fix broken scroll wheel | |
" inoremap <Esc>[62~ <C-X><C-E> | |
" inoremap <Esc>[63~ <C-X><C-Y> | |
nnoremap <Esc>[62~ <C-E> | |
nnoremap <Esc>[63~ <C-Y> | |
endif | |
silent! colorscheme NeoSolarized | |
set mouse=a " Automatically enable mouse usage | |
set mousehide " Hide the mouse cursor while typing | |
set laststatus=2 " Make the second to last line of vim our status line | |
set tabpagemax=15 " Only show 15 tabs | |
set noerrorbells visualbell t_vb= " No annoying sound on errors | |
set shortmess=aoOtI " Abbrev. of messages (avoids 'hit enter') | |
highlight clear SignColumn " SignColumn should match background | |
highlight clear LineNr " Current line number row will have same background color in relative mode | |
set backspace=indent,eol,start " Backspace for dummies | |
set linespace=0 " No extra spaces between rows | |
set nu " Line numbers on | |
set completeopt+=noinsert,noselect | |
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 height | |
set ignorecase " Case insensitive search | |
set smartcase " Case sensitive when uc present | |
set wildmenu " Show list instead of just completing | |
"set wildmode=list:longest,full " Command <Tab> completion, list matches, then longest common part, then all | |
set completeopt-=preview " Disable autocomplete preview | |
set whichwrap=b,s,h,l,<,>,[,] " Backspace and cursor keys wrap too | |
set scrolljump=5 " Lines to scroll when cursor leaves screen | |
set scrolloff=3 " Minimum lines to keep above and below cursor | |
set foldenable " Auto fold code | |
set foldlevel=5 | |
set list | |
" Highlight problematic whitespace | |
set listchars=tab:›\ ,trail:•,extends:#,nbsp:. | |
set showbreak=··· | |
set nowrap " Do not wrap long lines | |
set autoindent " Indent at the same level of the previous line | |
set shiftwidth=4 " Use indents of 4 spaces | |
set expandtab " Tabs are spaces, not tabs | |
set tabstop=4 " An indentation every four columns | |
set softtabstop=4 " Let backspace delete indent | |
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J) | |
set splitright " Puts new vertical split windows to the right of the current | |
set splitbelow " Puts new split windows to the bottom of the current | |
set pastetoggle=<F12> " paste toggle (sane indentation pastes) | |
" Disable menu.vim | |
if has('gui_running') | |
set guioptions=Mc | |
endif | |
" set guifont=* to select fonts | |
" set guifont? to get the name of the current font | |
" set guifont=Consolas\ for\ Powerline\ FixedD:h11 | |
if has('gui_macvim') | |
set guifont=Ubuntu\ Mono\ Nerd\ Font\ Complete\ Mono\ Windows\ Compatible:h15 | |
else | |
set guifont=UbuntuMono_NF:h12:cANSI:qDRAFT | |
endif | |
if has('clipboard') | |
if has('unnamedplus') " When possible use + register for copy-paste | |
set clipboard=unnamed,unnamedplus | |
else " On mac and Windows, use * register for copy-paste | |
set clipboard=unnamed | |
endif | |
endif | |
" copy cut and paste settings for clipboard | |
vmap <C-c> "+y | |
vmap <C-x> "+c | |
vmap <C-v> c<ESC>"+p | |
imap <C-v> <C-r><C-o>+ | |
" use Ctrl-S for saving, also in insert mode | |
" make sure to set these two lines in ~/.bash_profile and ~/.zshrc | |
" bind -r '\C-s' | |
" stty -ixon | |
nmap <c-s> :w<CR> | |
imap <c-s> <Esc>:w<CR>a | |
imap <c-s> <Esc><c-s> | |
" Quit | |
inoremap <C-Q> <esc>:q<cr> | |
nnoremap <C-Q> :q<cr> | |
vnoremap <C-Q> <esc> | |
nnoremap <Leader>q :q<cr> | |
nnoremap <Leader>Q :qa!<cr> | |
" Stupid shift key fixes | |
if has("user_commands") | |
command! -bang -nargs=* -complete=file E e<bang> <args> | |
command! -bang -nargs=* -complete=file W w<bang> <args> | |
command! -bang -nargs=* -complete=file Wq wq<bang> <args> | |
command! -bang -nargs=* -complete=file WQ wq<bang> <args> | |
command! -bang Wa wa<bang> | |
command! -bang WA wa<bang> | |
command! -bang Q q<bang> | |
command! -bang QA qa<bang> | |
command! -bang Qa qa<bang> | |
endif | |
" Clear current search highlighting by fast // | |
nmap <silent> // :nohlsearch<CR> | |
" disable entering ex mode | |
nnoremap Q <nop> | |
" Move up and down in autocomplete with <c-j> and <c-k> | |
inoremap <expr> <C-j> ("\<C-n>") | |
inoremap <expr> <C-k> ("\<C-p>") | |
" Visual shifting (does not exit Visual mode) | |
vnoremap < <gv | |
vnoremap > >gv | |
" For when you forget to sudo.. Really Write the file. | |
cmap w!! w !sudo tee % >/dev/null | |
" easier split navigations: http://robots.thoughtbot.com/vim-splits-move-faster-and-more-naturally | |
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> | |
" reselect what was just pasted | |
nnoremap <leader>v V`] | |
" Visual shifting (does not exit Visual mode) | |
vnoremap < <gv | |
vnoremap > >gv | |
nnoremap <silent> <leader>t2 :setl shiftwidth=2 softtabstop=2<CR> | |
nnoremap <silent> <leader>t4 :setl shiftwidth=4 softtabstop=4<CR> | |
nnoremap <silent> <leader>t8 :setl shiftwidth=8 softtabstop=8<CR> | |
" plugin configurations {{{ | |
if executable('rg') | |
" Use rg over grep | |
set grepprg=rg\ --vimgrep\ --no-heading | |
set grepformat=%f:%l:%c:%m,%f:%l:%m | |
endif | |
" " ctrlp.vim {{{ | |
" let g:ctrlp_cache_dir = expand(s:settings.cache . '/ctrlp') | |
" " call s:Mkdirp(s:settings.cache . '/vim-ctrlp-session') | |
" let g:ctrlp_working_path_mode = 'ra' | |
" let g:ctrlp_lazy_update = 1 | |
" let g:ctrlp_max_files = 0 | |
" let g:ctrlp_clear_cache_on_exit = 0 " don't clear cache when exit | |
" let g:ctrlp_funky_syntax_highlight = 1 | |
" let g:ctrlp_match_window = 'results:100000' | |
" " let g:ctrlp_session_path = s:settings.cache . '/vim-ctrlp-session' | |
" let g:user_command_async = 1 | |
" if executable('rg') | |
" let g:ctrlp_user_command = 'rg --files -F --color never --hidden --follow --glob "!.git/*" %s' | |
" " let g:ctrlp_use_caching = 0 " rg is fast enough that CtrlP doesn't need to cache | |
" endif | |
" if has('python') || has('python3') | |
" let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' } | |
" endif | |
" " nnoremap <Leader>r :CtrlPMRUFiles<cr> | |
" " nnoremap <Leader>ss :CtrlPSession<CR> | |
" nnoremap <Leader>o :CtrlPFunky<Cr> | |
" nnoremap <Leader>ft :CtrlPFiletype<CR> | |
" nnoremap <Leader>cs :CtrlPColorscheme<CR> | |
" | |
" " }}} | |
" lightline {{{ | |
if s:settings.is_win && !has('gui_running') | |
let g:lightline = { | |
\ 'colorscheme': 'solarized', | |
\ 'component': { | |
\ 'readonly': '%{&readonly?"x":""}', | |
\ }, | |
\ 'separator': { 'left': '', 'right': '' }, | |
\ 'subseparator': { 'left': '|', 'right': '|' } | |
\ } | |
else | |
let g:lightline = { | |
\ 'colorscheme': 'wombat', | |
\ 'component': { | |
\ 'readonly': '%{&readonly?"":""}', | |
\ }, | |
\ 'separator': { 'left': '', 'right': '' }, | |
\ 'subseparator': { 'left': '', 'right': '' } | |
\ } | |
endif | |
" }}} | |
" vim-easymotion {{{ | |
let g:EasyMotion_keys='hklyuiopnm,qwertzxcvbasdgjf' | |
nmap s <Plug>(easymotion-s) | |
" }}} | |
" nerdtree {{{ | |
nnoremap <silent> <leader>e :NERDTreeFind<CR> | |
nnoremap <silent> <leader>E :NERDTreeToggle<CR> | |
" }}} | |
" gina.vim {{{ | |
nnoremap <leader>gs :Gina status<CR> | |
nnoremap <leader>gb :Gina blame : --use-author-instead<CR> | |
" }}} | |
" vim-gtfo {{{ | |
if s:settings.is_win | |
let g:gtfo#terminals = { 'win' : 'cmd /k' } | |
endif | |
"}}} | |
" fzf {{{ | |
if executable('fzf') | |
let g:ctrlp_map = '' | |
let g:fzf_session_path = s:settings.cache . './fzf-session' | |
call s:Mkdirp(g:fzf_session_path) | |
" function! s:on_fzf_session_select(item) abort | |
" call ctrlp_session#load(a:item) | |
" endfunction | |
" command! FZFSessions call fzf#run({ 'source': ctrlp_session#list(), 'sink': function('<sid>on_fzf_session_select') }) | |
" nnoremap <Leader>ss :FZFSessions<CR> | |
if s:settings.is_win | |
command! -bang -nargs=* GGrep | |
\ call fzf#vim#grep('git grep --line-number '.<q-args>, 0, <bang>0) | |
command! -bang -nargs=* Find | |
\ call fzf#vim#grep('rg '.$RG_OPTIONS.' --column --line-number --no-heading --fixed-strings --ignore-case '.<q-args>,1,<bang>0) | |
else | |
command! -bang -nargs=* GGrep | |
\ call fzf#vim#grep('git grep --color=always --line-number '.shellescape(<q-args>), 0, <bang>0) | |
command! -bang -nargs=* Find | |
\ call fzf#vim#grep('rg '.$RG_OPTIONS.' --column --line-number --no-heading --fixed-strings --ignore-case '.shellescape(<q-args>),1,<bang>0) | |
endif | |
command! GModified :call fzf#run({ 'source': 'git ls-files -m', 'sink': 'e' }) | |
nnoremap <C-p> :GitFiles<cr> | |
nnoremap <Leader>ft :Filetypes<CR> | |
nnoremap <Leader>cs :Colors<CR> | |
nnoremap <leader>fw :Find <c-r>=expand("<cword>")<CR> | |
" nnoremap <leader>O :FZF %:p:h<CR> | |
nnoremap <leader>gf :GitFiles<CR> | |
nnoremap <Leader>gc :Commits<cr> | |
nnoremap <leader>gm :GModified<CR> | |
nnoremap <leader>gg :GGrep <c-r>=expand("<cword>")<CR> | |
" fzf-mru.vim | |
nnoremap <Leader>r :FZFMru<cr> | |
" fzf-sessions.vim | |
nnoremap <Leader>ss :Sessions<cr> | |
" completion | |
imap <C-x><C-l> <plug>(fzf-complete-line) | |
endif | |
" }}} | |
" ultisnips {{{ | |
if has('python3') | |
" let g:UltiSnipsExpandTrigger = "<Plug>(ultisnips_expand)" | |
" inoremap <silent> <c-u> <c-r>=cm#sources#ultisnips#trigger_or_popup("\<Plug>(ultisnips_expand)")<cr> | |
endif | |
" }}} | |
" ncm {{{ | |
if s:settings.completionlib == 'ncm' | |
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" | |
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" | |
inoremap <expr> <cr> pumvisible() ? "\<C-y>\<cr>" : "\<cr>" | |
autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif | |
endif | |
" }}} | |
" ale {{{ | |
let g:ale_sign_column_always = 1 | |
let g:ale_sign_error = '✗' | |
let g:ale_sign_warning = '--' | |
" }}} | |
" asyncomplete.vim {{{ | |
if s:settings.completionlib == 'asyncomplete' | |
" let g:asyncomplete_log_file = expand('~/Desktop/asyncomplete.log') | |
" let g:lsp_log_verbose = 1 | |
" let g:lsp_log_file = expand('~/Desktop/lsp.log') | |
imap <c-space> <Plug>(asyncomplete_force_refresh) | |
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" | |
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" | |
inoremap <expr> <cr> pumvisible() ? "\<C-y>\<cr>" : "\<cr>" | |
autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif | |
let s:asyncomplete_blacklist = [] | |
if executable('pyls') | |
" pip install python-language-server | |
call add(s:asyncomplete_blacklist, 'python') | |
au User lsp_setup call lsp#register_server({ | |
\ 'name': 'pyls', | |
\ 'cmd': {server_info->['pyls']}, | |
\ 'whitelist': ['python'], | |
\ }) | |
endif | |
if executable('rls') | |
" refer to https://github.com/rust-lang-nursery/rls on how to setup rls | |
call add(s:asyncomplete_blacklist, 'rust') | |
au User lsp_setup call lsp#register_server({ | |
\ 'name': 'rls', | |
\ 'cmd': {server_info->['rustup', 'run', 'nightly', 'rls']}, | |
\ 'whitelist': ['rust'], | |
\ }) | |
endif | |
if 0 | |
call add(s:asyncomplete_blacklist, 'go') | |
au User lsp_setup call lsp#register_server({ | |
\ 'name': 'go-langserver', | |
\ 'cmd': {server_info->['go-langserver', '-mode', 'stdio']}, | |
\ 'whitelist': ['go'], | |
\ }) | |
elseif executable('gocode') | |
call add(s:asyncomplete_blacklist, 'go') | |
au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#gocode#get_source_options({ | |
\ 'name': 'gocode', | |
\ 'whitelist': ['go'], | |
\ 'completor': function('asyncomplete#sources#gocode#completor') | |
\ })) | |
endif | |
if 0 " executable('flow-language-server') | |
call add(s:asyncomplete_blacklist, 'javascript') | |
au User lsp_setup call lsp#register_server({ | |
\ 'name': 'flow', | |
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'flow-language-server', '--stdio']}, | |
\ 'whitelist': ['javascript'], | |
\ }) | |
endif | |
" au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#flow#get_source_options({ | |
" \ 'name': 'flow', | |
" \ 'whitelist': ['javascript'], | |
" \ 'completor': function('asyncomplete#sources#flow#completor'), | |
" \ })) | |
if executable('docker-langserver') | |
" https://github.com/rcjsuen/dockerfile-language-server-nodejs | |
" npm install -g dockerfile-language-server-nodejs | |
call add(s:asyncomplete_blacklist, 'dockerfile') | |
au User lsp_setup call lsp#register_server({ | |
\ 'name': 'dockerfile', | |
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'docker-langserver', '--stdio']}, | |
\ 'whitelist': ['dockerfile'], | |
\ }) | |
endif | |
if executable('typescript-language-server') | |
" npm i -g typescript-language-server | |
call add(s:asyncomplete_blacklist, 'typescript') | |
au User lsp_setup call lsp#register_server({ | |
\ 'name': 'typescript-language-server', | |
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'typescript-language-server', '--stdio']}, | |
\ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'tsconfig.json'))}, | |
\ 'whitelist': ['typescript'], | |
\ }) | |
autocmd FileType typescript nnoremap <buffer><silent> <c-]> :LspDefinition<cr> | |
autocmd FileType typescript nnoremap <buffer><silent> K :LspHover<cr> | |
" npm i -g javascript-typescript-langserver | |
" au User lsp_setup call lsp#register_server({ | |
" \ 'name': 'typescript-language-server', | |
" \ 'cmd': {server_info->['javascript-typescript-stdio.cmd', '-t', '-l', expand('~/Desktop/tslangserver.log')]}, | |
" \ 'whitelist': ['typescript'], | |
" \ }) | |
endif | |
au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#omni#get_source_options({ | |
\ 'name': 'omni', | |
\ 'whitelist': ['*'], | |
\ 'blacklist': s:asyncomplete_blacklist, | |
\ 'completor': function('asyncomplete#sources#omni#completor'), | |
\ })) | |
call add(s:asyncomplete_blacklist, 'vim') | |
au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#necovim#get_source_options({ | |
\ 'name': 'necovim', | |
\ 'whitelist': ['vim'], | |
\ 'completor': function('asyncomplete#sources#necovim#completor'), | |
\ })) | |
au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#necosyntax#get_source_options({ | |
\ 'name': 'necosyntax', | |
\ 'whitelist': ['*'], | |
\ 'blacklist': s:asyncomplete_blacklist, | |
\ 'completor': function('asyncomplete#sources#necosyntax#completor'), | |
\ })) | |
au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#buffer#get_source_options({ | |
\ 'name': 'buffer', | |
\ 'whitelist': ['*'], | |
\ 'blacklist': s:asyncomplete_blacklist, | |
\ 'completor': function('asyncomplete#sources#buffer#completor'), | |
\ })) | |
" au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#tags#get_source_options({ | |
" \ 'name': 'tags', | |
" \ 'whitelist': ['c'], | |
" \ 'completor': function('asyncomplete#sources#tags#completor'), | |
" \ })) | |
endif | |
" }}} | |
" deoplete.nvim {{{ | |
if s:settings.completionlib == 'deoplete' | |
let g:deoplete#enable_at_startup=1 | |
let g:deoplete#enable_smart_case=1 | |
let g:deoplete#enable_camel_case=1 | |
let g:deoplete#auto_complete_start_length=1 | |
inoremap <silent><expr> <TAB> | |
\ pumvisible() ? "\<C-n>" : | |
\ <SID>check_back_space() ? "\<TAB>" : | |
\ deoplete#mappings#manual_complete() | |
function! s:check_back_space() abort "{{{ | |
let col = col('.') - 1 | |
return !col || getline('.')[col - 1] =~ '\s' | |
endfunction"}}} | |
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>" | |
endif | |
" }}} | |
" tscompletejob {{{ | |
autocmd FileType typescript nnoremap <silent> <leader>sr :TsCompleteJobReferences<cr> | |
" }}} | |
" vim-lookup {{{ | |
autocmd FileType vim nnoremap <buffer><silent> <c-]> :call lookup#lookup()<cr> | |
autocmd FileType vim nnoremap <buffer><silent> <c-t> :call lookup#pop()<cr> | |
" }}} | |
" vim-closetag {{{ | |
" https://github.com/alvan/vim-closetag/issues/1 | |
let g:closetag_filenames = "*.xml,*.html,*.html,*.tsx,*.config" | |
au FileType xml,html,xhtml,js,typescript let b:delimitMate_matchpairs = "(:),[:],{:}" | |
" }}} | |
" }}} | |
if filereadable(expand('~/.vimrc.local')) | |
source ~/.vimrc.local | |
endif | |
" vim: set sw=2 ts=2 sts=2 et tw=78 foldmarker={{{,}}} foldmethod=marker spell: |
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
# curl https://gist.githubusercontent.com/prabirshrestha/279d8b179d9353fe8694/raw/.zshrc -o ~/.zshrc | |
# Path to your oh-my-zsh installation. | |
export ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="babun" | |
# use agnoster if you want powerlines | |
#ZSH_THEME="agnoster" | |
plugins=(colored-man docker git jake-node jump npm nvm z) | |
source $ZSH/oh-my-zsh.sh | |
# User configuration | |
export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# You may need to manually set your language environment | |
# export LANG=en_US.UTF-8 | |
# Preferred editor for local and remote sessions | |
# if [[ -n $SSH_CONNECTION ]]; then | |
# export EDITOR='vim' | |
# else | |
# export EDITOR='mvim' | |
# fi | |
# Compilation flags | |
# export ARCHFLAGS="-arch x86_64" | |
# enable vi bindings | |
bindkey -v | |
bindkey -M viins 'jj' vi-cmd-mode | |
stty -ixon |
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
#!/bin/zsh | |
# curl https://gist.githubusercontent.com/prabirshrestha/279d8b179d9353fe8694/raw/babun-post-install | zsh | |
successfully() { | |
$* || (echo "\nfailed" 1>&2 && exit 1) | |
} | |
fancy_echo() { | |
echo "\n$1" | |
} | |
fancy_echo "Updating babun" | |
successfully pact update | |
fancy_echo "Updating ~/.zshrc" | |
successfully curl https://gist.githubusercontent.com/prabirshrestha/279d8b179d9353fe8694/raw/.zshrc -o ~/.zshrc | |
fancy_echo "Installing tmux" | |
successfully pact install tmux | |
fancy_echo "Installing solarized dark theme and powerconsolas for mintty" | |
successfully curl https://gist.githubusercontent.com/prabirshrestha/279d8b179d9353fe8694/raw/.minttyrc -o ~/.minttyrc | |
fancy_echo "Installing the_silver_searcher (ag)" | |
successfully pact install automake pkg-config libpcre-devel liblzma-devel | |
successfully git clone https://github.com/ggreer/the_silver_searcher ~/ag | |
successfully pushd ~/ag | |
successfully bash -x -o igncr ./build.sh && make install | |
successfully cd .. | |
successfully rm -rf ~/ag | |
successfully popd | |
fanyc_echo "Updating gitconfig" | |
successfully git config --global core.autocrlf true | |
successfully git config --global user.name "prabirshrestha" | |
successfully git config --global user.email "[email protected]" | |
echo "execute 'chere -i -t mintty' in admin mode to enable Zsh Prompt Here" | |
source ~/.zshrc | |
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
START http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/prabirshrestha/279d8b179d9353fe8694/raw/boxstart.ps1 |
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
Set-ExplorerOptions -showFileExtensions | |
Disable-BingSearch | |
Enable-RemoteDesktop | |
Enable-MicrosoftUpdate | |
cinst curl | |
cinst googlechrome | |
cinst visualstudiocode | |
cinst googledrive | |
cinst python | |
cinst python2 | |
cinst wget | |
cinst nuget.commandline | |
cinst procexp | |
cinst paint.net | |
cinst fiddler4 | |
cinst mingw | |
cinst webpicmd | |
cinst webpi | |
cinst cmake | |
cinst redis-64 | |
cinst imagemagick | |
cinst cpu-z | |
cinst kdiff3 | |
cinst dotpeek | |
cinst gpg4win | |
cinst nugetpackageexplorer | |
cinst f.lux | |
cinst linqpad | |
cinst sourcecodepro | |
cinst rabbitmq | |
cinst ansicon | |
cinst windbg | |
cinst sudo | |
cinst clink | |
cinst ctags | |
cinst jq | |
cinst ack | |
cinst dependencywalker | |
cinst postgresql | |
cinst pgadmin3 | |
cinst zoomit |
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
rmdir /s /q vim80 | |
powershell -NoProfile -ExecutionPolicy Bypass -Command "(new-object System.Net.WebClient).DownloadFile('http://tuxproject.de/projects/vim/complete-x64.7z', 'complete-x64.7z')" | |
"%ProgramFiles%\7-Zip\7z.exe" x complete-x64.7z -ovim80 | |
del complete-x64.7z | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment