initial commit
This commit is contained in:
parent
54241f0303
commit
6de728230d
|
|
@ -0,0 +1,88 @@
|
|||
#set-window-option -g xterm-keys
|
||||
#set-option -g default-terminal "xterm-256color"
|
||||
set-option -g default-terminal "screen-256color"
|
||||
set -g pane-border-status
|
||||
|
||||
bind c new-window -c "#{pane_current_path}"
|
||||
bind '"' split-window -c "#{pane_current_path}"
|
||||
bind % split-window -h -c "#{pane_current_path}"
|
||||
|
||||
######################
|
||||
### DESIGN CHANGES ###
|
||||
######################
|
||||
|
||||
# panes
|
||||
set -g pane-border-style fg=black
|
||||
set -g pane-active-border-style fg=brightred
|
||||
|
||||
## Status bar design
|
||||
# status line
|
||||
set -g status-justify left
|
||||
set -g status-style bg=default,fg=colour12
|
||||
set -g status-interval 2
|
||||
|
||||
# messaging
|
||||
set -g message-style fg=black,bg=yellow
|
||||
set -g message-command-style fg=blue,bg=black
|
||||
|
||||
#window mode
|
||||
setw -g mode-style bg=colour6,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-style bg=colour0,fg=colour11,dim
|
||||
setw -g window-status-style bg=green,fg=black,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
|
||||
|
||||
# The modes {
|
||||
setw -g clock-mode-colour colour135
|
||||
setw -g mode-style fg=colour196,bg=colour238,bold
|
||||
|
||||
# }
|
||||
# The panes {
|
||||
|
||||
set -g pane-border-style bg=colour235,fg=colour238
|
||||
set -g pane-active-border-style bg=colour236,fg=colour51
|
||||
|
||||
# }
|
||||
# The statusbar {
|
||||
|
||||
set -g status-position bottom
|
||||
set -g status-style bg=colour234,fg=colour137,dim
|
||||
set -g status-left ''
|
||||
set -g status-right '#[fg=colour233,bg=colour241,bold] %Y-%m-%d #[fg=colour233,bg=colour245,bold] %H:%M '
|
||||
set -g status-right-length 50
|
||||
set -g status-left-length 20
|
||||
|
||||
setw -g window-status-current-style fg=colour81,bg=colour238,bold
|
||||
setw -g window-status-current-format ' #I#[fg=colour250]:#[fg=colour255]#W#[fg=colour50]#F '
|
||||
|
||||
setw -g window-status-style fg=colour138,bg=colour235,none
|
||||
setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F '
|
||||
|
||||
setw -g window-status-bell-style fg=colour255,bg=colour1,bold
|
||||
|
||||
# }
|
||||
# The messages {
|
||||
|
||||
set -g message-style fg=colour232,bg=colour166,bold
|
||||
|
||||
# }
|
||||
|
||||
#set -g default-shell /bin/zsh
|
||||
set -g default-shell /usr/bin/fish
|
||||
|
||||
# scrollback limit
|
||||
set-option -g history-limit 20000
|
||||
|
|
@ -0,0 +1,384 @@
|
|||
let mapleader = ","
|
||||
" set the runtime path to include Vundle and initialize
|
||||
set rtp+=~/.vim/bundle/Vundle.vim
|
||||
call vundle#begin()
|
||||
|
||||
" Vundle bundles
|
||||
Bundle 'gmarik/Vundle.vim'
|
||||
Bundle 'tomasr/molokai'
|
||||
Bundle 'tpope/vim-dispatch'
|
||||
Bundle 'vim-scripts/JavaDecompiler.vim'
|
||||
Bundle 'jszakmeister/vim-togglecursor'
|
||||
Plugin 'xolox/vim-notes'
|
||||
Plugin 'xolox/vim-misc'
|
||||
Plugin 'kien/ctrlp.vim'
|
||||
Plugin 'alvan/vim-closetag'
|
||||
Plugin 'elzr/vim-json'
|
||||
Plugin 'fatih/vim-go'
|
||||
Plugin 'machakann/vim-sandwich'
|
||||
Plugin 'junegunn/vim-easy-align'
|
||||
Plugin 'darfink/vim-plist'
|
||||
|
||||
call vundle#end()
|
||||
|
||||
let mapleader = ','
|
||||
let g:mapleader = ','
|
||||
|
||||
colorscheme molokai
|
||||
|
||||
" mape space to execute makro q
|
||||
map <Space> @q
|
||||
|
||||
" Nerdtree
|
||||
map <C-n> :NERDTreeTabsToggle<CR>
|
||||
|
||||
" ctr-p
|
||||
|
||||
nnoremap <C-Left> :tabprevious<CR>
|
||||
nnoremap <C-Right> :tabnext<CR>
|
||||
|
||||
set nu
|
||||
set nocompatible
|
||||
filetype indent plugin on
|
||||
set ignorecase
|
||||
set smartcase
|
||||
set backspace=indent,eol,start
|
||||
set autoindent
|
||||
set notimeout ttimeout ttimeoutlen=200
|
||||
set background=dark
|
||||
syntax on
|
||||
set incsearch
|
||||
|
||||
command Wm w|Make
|
||||
|
||||
imap jk <Esc>
|
||||
|
||||
set cursorline
|
||||
|
||||
" Return to last edit position when opening files (You want this!)
|
||||
autocmd BufReadPost *
|
||||
\ if line("'\"") > 0 && line("'\"") <= line("$") |
|
||||
\ exe "normal! g`\"" |
|
||||
\ endif
|
||||
|
||||
"""""""""""""""""""""""""" GO Settings
|
||||
|
||||
" go auto imports
|
||||
let g:go_fmt_autosave = 1
|
||||
let g:go_fmt_fail_silently = 1
|
||||
let g:go_fmt_command = "goimports"
|
||||
|
||||
" Remap some commands
|
||||
au FileType go nmap <leader>r <Plug>(go-run)
|
||||
au FileType go nmap <leader>b <Plug>(go-build)
|
||||
au FileType go nmap <leader>ds <Plug>(go-def-split)
|
||||
au FileType go nmap <leader>dv <Plug>(go-def-vertical)
|
||||
au FileType go nmap <leader>dt <Plug>(go-def-tab)
|
||||
|
||||
" Highlighting
|
||||
let g:go_highlight_functions = 1
|
||||
let g:go_highlight_methods = 1
|
||||
let g:go_highlight_structs = 1
|
||||
let g:go_highlight_interfaces = 1
|
||||
let g:go_highlight_operators = 1
|
||||
let g:go_highlight_build_constraints = 1
|
||||
|
||||
|
||||
"""""""""""""""""""""""" END GO Settings
|
||||
"""""""""""""""""""""""" Omnicomplete Settings (more like IDE)
|
||||
|
||||
set completeopt=longest,menuone,preview
|
||||
|
||||
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
|
||||
inoremap <expr> <C-n> pumvisible() ? '<C-n>' :
|
||||
\ '<C-n><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
|
||||
|
||||
inoremap <expr> <M-,> pumvisible() ? '<C-n>' :
|
||||
\ '<C-x><C-o><C-n><C-p><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
|
||||
|
||||
"inoremap <C-Space> <C-x><C-o>
|
||||
"inoremap <C-@> <C-Space>
|
||||
inoremap <C-@> <c-x><c-o>
|
||||
"""""""""""""""""""""""" END Omnicomplete Settings (more like IDE)
|
||||
|
||||
|
||||
|
||||
let g:togglecursor_default = "block"
|
||||
|
||||
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Maintainer:
|
||||
" Amir Salihefendic
|
||||
" http://amix.dk - amix@amix.dk
|
||||
"
|
||||
" Version:
|
||||
" 5.0 - 29/05/12 15:43:36
|
||||
"
|
||||
" Blog_post:
|
||||
" http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github
|
||||
"
|
||||
" Awesome_version:
|
||||
" Get this config, nice color schemes and lots of plugins!
|
||||
"
|
||||
" Install the awesome version from:
|
||||
"
|
||||
" https://github.com/amix/vimrc
|
||||
"
|
||||
" Syntax_highlighted:
|
||||
" http://amix.dk/vim/vimrc.html
|
||||
"
|
||||
" Raw_version:
|
||||
" http://amix.dk/vim/vimrc.txt
|
||||
"
|
||||
" Sections:
|
||||
" -> General
|
||||
" -> VIM user interface
|
||||
" -> Colors and Fonts
|
||||
" -> Files and backups
|
||||
" -> Text, tab and indent related
|
||||
" -> Visual mode related
|
||||
" -> Moving around, tabs and buffers
|
||||
" -> Status line
|
||||
" -> Editing mappings
|
||||
" -> vimgrep searching and cope displaying
|
||||
" -> Spell checking
|
||||
" -> Misc
|
||||
" -> Helper functions
|
||||
"
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => General
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Set to auto read when a file is changed from the outside
|
||||
set autoread
|
||||
|
||||
" With a map leader it's possible to do extra key combinations
|
||||
" like <leader>w saves the current file
|
||||
let mapleader = ","
|
||||
let g:mapleader = ","
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => VIM user interface
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Set 7 lines to the cursor - when moving vertically using j/k
|
||||
set so=7
|
||||
|
||||
" Turn on the WiLd menu
|
||||
set wildmenu
|
||||
|
||||
" Ignore compiled files
|
||||
set wildignore=*.o,*~,*.pyc
|
||||
|
||||
" Height of the command bar
|
||||
set cmdheight=2
|
||||
|
||||
" A buffer becomes hidden when it is abandoned
|
||||
set hid
|
||||
|
||||
" Configure backspace so it acts as it should act
|
||||
set backspace=eol,start,indent
|
||||
set whichwrap+=<,>,h,l
|
||||
|
||||
" Don't redraw while executing macros (good performance config)
|
||||
set lazyredraw
|
||||
|
||||
" Show matching brackets when text indicator is over them
|
||||
set showmatch
|
||||
" How many tenths of a second to blink when matching brackets
|
||||
set mat=2
|
||||
|
||||
" No annoying sound on errors
|
||||
set noerrorbells
|
||||
set novisualbell
|
||||
set t_vb=
|
||||
set tm=500
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Colors and Fonts
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
" Set extra options when running in GUI mode
|
||||
if has("gui_running")
|
||||
set guioptions-=T
|
||||
set guioptions+=e
|
||||
set t_Co=256
|
||||
set guitablabel=%M\ %t
|
||||
endif
|
||||
|
||||
" Set utf8 as standard encoding and en_US as the standard language
|
||||
set encoding=utf8
|
||||
|
||||
" Use Unix as the standard file type
|
||||
set ffs=unix,dos,mac
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Files, backups and undo
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Turn backup off, since most stuff is in SVN, git et.c anyway...
|
||||
set nobackup
|
||||
set nowb
|
||||
set noswapfile
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Text, tab and indent related
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Use spaces instead of tabs
|
||||
set expandtab
|
||||
|
||||
" Be smart when using tabs ;)
|
||||
set smarttab
|
||||
|
||||
" 1 tab == 4 spaces
|
||||
set shiftwidth=4
|
||||
set tabstop=4
|
||||
|
||||
" Linebreak on 500 characters
|
||||
set lbr
|
||||
set tw=500
|
||||
|
||||
set ai "Auto indent
|
||||
set si "Smart indent
|
||||
set wrap "Wrap lines
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Moving around, tabs, windows and buffers
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Treat long lines as break lines (useful when moving around in them)
|
||||
map j gj
|
||||
map k gk
|
||||
|
||||
""""""""""""""""""""""""""""""
|
||||
" => Status line
|
||||
""""""""""""""""""""""""""""""
|
||||
" Always show the status line
|
||||
set laststatus=2
|
||||
|
||||
" Format the status line
|
||||
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Editing mappings
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Move a line of text using ALT+[jk] or Comamnd+[jk] on mac
|
||||
nmap <M-j> mz:m+<cr>`z
|
||||
nmap <M-k> mz:m-2<cr>`z
|
||||
vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z
|
||||
vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z
|
||||
|
||||
if has("mac") || has("macunix")
|
||||
nmap <D-j> <M-j>
|
||||
nmap <D-k> <M-k>
|
||||
vmap <D-j> <M-j>
|
||||
vmap <D-k> <M-k>
|
||||
endif
|
||||
|
||||
" Delete trailing white space on save, useful for Python and CoffeeScript ;)
|
||||
func! DeleteTrailingWS()
|
||||
exe "normal mz"
|
||||
%s/\s\+$//ge
|
||||
exe "normal `z"
|
||||
endfunc
|
||||
autocmd BufWrite *.py :call DeleteTrailingWS()
|
||||
autocmd BufWrite *.coffee :call DeleteTrailingWS()
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Misc
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Remove the Windows ^M - when the encodings gets messed up
|
||||
noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Helper functions
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
function! CmdLine(str)
|
||||
exe "menu Foo.Bar :" . a:str
|
||||
emenu Foo.Bar
|
||||
unmenu Foo
|
||||
endfunction
|
||||
|
||||
function! VisualSelection(direction) range
|
||||
let l:saved_reg = @"
|
||||
execute "normal! vgvy"
|
||||
|
||||
let l:pattern = escape(@", '\\/.*$^~[]')
|
||||
let l:pattern = substitute(l:pattern, "\n$", "", "")
|
||||
|
||||
if a:direction == 'b'
|
||||
execute "normal ?" . l:pattern . "^M"
|
||||
elseif a:direction == 'gv'
|
||||
call CmdLine("vimgrep " . '/'. l:pattern . '/' . ' **/*.')
|
||||
elseif a:direction == 'replace'
|
||||
call CmdLine("%s" . '/'. l:pattern . '/')
|
||||
elseif a:direction == 'f'
|
||||
execute "normal /" . l:pattern . "^M"
|
||||
endif
|
||||
|
||||
let @/ = l:pattern
|
||||
let @" = l:saved_reg
|
||||
endfunction
|
||||
|
||||
|
||||
" Returns true if paste mode is enabled
|
||||
function! HasPaste()
|
||||
if &paste
|
||||
return 'PASTE MODE '
|
||||
en
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
" Don't close window, when deleting a buffer
|
||||
command! Bclose call <SID>BufcloseCloseIt()
|
||||
function! <SID>BufcloseCloseIt()
|
||||
let l:currentBufNum = bufnr("%")
|
||||
let l:alternateBufNum = bufnr("#")
|
||||
|
||||
if buflisted(l:alternateBufNum)
|
||||
buffer #
|
||||
else
|
||||
bnext
|
||||
endif
|
||||
|
||||
if bufnr("%") == l:currentBufNum
|
||||
new
|
||||
endif
|
||||
|
||||
if buflisted(l:currentBufNum)
|
||||
execute("bdelete! ".l:currentBufNum)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" make as :m
|
||||
command MyMake :w|:Make
|
||||
" Use :ww instead of :WriteWithSudo
|
||||
cnoreabbrev m MyMake
|
||||
|
||||
" tex files with textwidth 80
|
||||
au BufRead,BufNewFile *.tex setlocal textwidth=80
|
||||
set fo-=t
|
||||
set fo+=c
|
||||
|
||||
command JsonIndentReorder :%!python -m json.tool
|
||||
command JsonIndent :%!python3 -c "import json, sys, collections; print(json.dumps(json.loads(sys.stdin.read(), object_pairs_hook=collections.OrderedDict), indent=4))"
|
||||
command XmlIndent :%!xmllint --format -
|
||||
|
||||
" set font and size in MacVim
|
||||
set guifont=Hack-Regular:h15
|
||||
" disable terminal bell in MacVim
|
||||
autocmd! GUIEnter * set vb t_vb=
|
||||
|
||||
" set shortcut for easyalign
|
||||
au FileType markdown vmap <Leader>a :EasyAlign*<Bar><Enter>
|
||||
|
||||
" unlimited undos even between closing and opening the editor
|
||||
set undofile
|
||||
set undodir=~/.vim/undodir
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
if status is-interactive
|
||||
# Commands to run in interactive sessions can go here
|
||||
end
|
||||
|
||||
# Custom aliases
|
||||
alias cat='bat --style changes,numbers'
|
||||
alias ls='exa'
|
||||
alias ll='exa -bgla'
|
||||
alias la='exa -bgla'
|
||||
# alias clear='command clear; task limit:3 next; echo ""; echo ""'
|
||||
# alias tui='taskwarrior-tui'
|
||||
|
||||
clear
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
|
||||
# install
|
||||
sudo apt-get update
|
||||
sudo apt-get install tmux vim exa bat git ripgrep
|
||||
|
||||
|
||||
# install vundle and all packages
|
||||
if [ ! -d "$HOME/.vim/bundle/Vundle.vim" ]; then
|
||||
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
|
||||
else
|
||||
echo "Vundle already installed"
|
||||
fi
|
||||
|
||||
vim +'PlugInstall --sync' +qa
|
||||
|
||||
|
||||
# link files
|
||||
|
||||
ln -s $PWD/.tmux.conf $HOME/
|
||||
ln -s $PWD/.vimrc $HOME/
|
||||
mkdir -p $HOME/.config/fish/
|
||||
ln -s $PWD/config.fish $HOME/.config/fish/
|
||||
Loading…
Reference in New Issue