commit
9c8ced70f3
5 changed files with 149 additions and 0 deletions
@ -0,0 +1,26 @@
|
||||
# If not running interactively, don't do anything |
||||
[[ "$-" != *i* ]] && return |
||||
|
||||
export EDITOR=vim |
||||
#PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ ' |
||||
GREEN="\[\e[0;32m\]" |
||||
RED="\[\e[0;31m\]" |
||||
YELLOW="\[\e[1;33m\]" |
||||
RESET="\[\e[0m\]" |
||||
|
||||
PS1="[$GREEN\u$RESET@$RED\h$RESET:$YELLOW\w$RESET]$" |
||||
|
||||
# Some shortcuts for different directory listings |
||||
alias ls='ls -hF --color=tty --group-directories-first' # classify files in colour |
||||
alias ll='ls -l' # long list |
||||
alias grep='grep --color' |
||||
alias tmux='tmux -2' |
||||
|
||||
# Umask |
||||
# |
||||
# /etc/profile sets 022, removing write perms to group + others. |
||||
# Set a more restrictive umask: i.e. no exec perms for others: |
||||
# umask 027 |
||||
# Paranoid: neither group nor others have any perms: |
||||
# umask 077 |
||||
|
||||
@ -0,0 +1,6 @@
|
||||
# if running bash |
||||
if [ -n "${BASH_VERSION}" ]; then |
||||
if [ -f "${HOME}/.bashrc" ]; then |
||||
source "${HOME}/.bashrc" |
||||
fi |
||||
fi |
||||
@ -0,0 +1,19 @@
|
||||
|
||||
setw -g xterm-keys on |
||||
set -g default-terminal "screen-256color" |
||||
set-option -g prefix C-a |
||||
bind-key C-a last-window |
||||
set-window-option -g mode-keys vi |
||||
set -s escape-time 0 |
||||
|
||||
bind -n C-h if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-h" "select-pane -L" |
||||
bind -n C-j if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-j" "select-pane -D" |
||||
bind -n C-k if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-k" "select-pane -U" |
||||
bind -n C-l if "[ $(tmux display -p '#{pane_current_command}') = vim ]" "send-keys C-l" "select-pane -R" |
||||
|
||||
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 |
||||
|
||||
@ -0,0 +1,94 @@
|
||||
filetype plugin on |
||||
syntax on |
||||
colorscheme deus |
||||
|
||||
" don't clutter directories with backup files |
||||
set nobackup |
||||
set nowritebackup |
||||
|
||||
set tabstop=4 |
||||
set shiftwidth=4 " set to same as tabstop for auto-indent |
||||
set foldmethod=syntax |
||||
set foldnestmax=1 |
||||
set autoindent |
||||
|
||||
" filename auto-completion |
||||
set wildmode=longest,list,full |
||||
set wildmenu |
||||
|
||||
" attempts to fix delay when mode switch, also need tmux option "set -s escape-time 0" |
||||
set ttimeoutlen=10 |
||||
|
||||
" line numbering gutter |
||||
set number |
||||
set numberwidth=3 |
||||
set cpoptions+=n " use gutter for wrapped lines |
||||
highlight LineNr term=bold cterm=NONE ctermfg=DarkGrey ctermbg=NONE gui=NONE guifg=DarkGrey guibg=NONE |
||||
|
||||
" airline plugin stuffs |
||||
set laststatus=2 |
||||
let g:airline#extensions#tabline#enabled = 1 |
||||
let g:airline#extensions#tabline#formatter = 'default' |
||||
let g:airline_theme='bubblegum' |
||||
let g:airline_left_sep = '' |
||||
let g:airline_left_alt_sep = '' |
||||
let g:airline_right_sep = '' |
||||
let g:airline_right_altsep = '' |
||||
let g:airline_section_c = '%{getcwd()}' |
||||
let g:airline_section_warning = '' " disable whitespace warnings |
||||
|
||||
" custom keybinds |
||||
" C-PageUp/Down conflicts with xfce-terminal, so there is a trick to fixing |
||||
" https://unix.stackexchange.com/questions/159979/xfce4-terminal-disable-individual-shortcut |
||||
map <C-PageDown> :bnext<CR> |
||||
map <C-PageUp> :bprev<CR> |
||||
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> |
||||
map <F5> :make<CR> |
||||
map <F6> :ccl<CR> |
||||
|
||||
" Automatically open, but do not go to (if there are errors) the quickfix / |
||||
" location list window, or close it when is has become empty. |
||||
" |
||||
" Note: Must allow nesting of autocmds to enable any customizations for quickfix |
||||
" buffers. |
||||
" Note: Normally, :cwindow jumps to the quickfix window if the command opens it |
||||
" (but not if it's already open). However, as part of the autocmd, this doesn't |
||||
" seem to happen. |
||||
autocmd QuickFixCmdPost [^l]* nested cwindow |
||||
autocmd QuickFixCmdPost l* nested lwindow |
||||
|
||||
" fix keycodes when running inside tmux |
||||
" http://tmux-users.narkive.com/M9tIqoa0/c-pageup-and-c-pagedown-seems-not-to-work-in-tmux |
||||
if &term =~ '^screen' && exists('$TMUX') |
||||
" Mouse mode |
||||
set mouse+=a |
||||
set ttymouse=xterm2 |
||||
|
||||
" tmux sends xterm-style keys when xterm-keys option is on |
||||
execute "set <xUp>=\e[1;*A" |
||||
execute "set <xDown>=\e[1;*B" |
||||
execute "set <xRight>=\e[1;*C" |
||||
execute "set <xLeft>=\e[1;*D" |
||||
execute "set <xHome>=\e[1;*H" |
||||
execute "set <xEnd>=\e[1;*F" |
||||
execute "set <Insert>=\e[2;*~" |
||||
execute "set <Delete>=\e[3;*~" |
||||
execute "set <PageUp>=\e[5;*~" |
||||
execute "set <PageDown>=\e[6;*~" |
||||
execute "set <xF1>=\e[1;*P" |
||||
execute "set <xF2>=\e[1;*Q" |
||||
execute "set <xF3>=\e[1;*R" |
||||
execute "set <xF4>=\e[1;*S" |
||||
execute "set <F5>=\e[15;*~" |
||||
execute "set <F6>=\e[17;*~" |
||||
execute "set <F7>=\e[18;*~" |
||||
execute "set <F8>=\e[19;*~" |
||||
execute "set <F9>=\e[20;*~" |
||||
execute "set <F10>=\e[21;*~" |
||||
execute "set <F11>=\e[23;*~" |
||||
execute "set <F12>=\e[24;*~" |
||||
endif |
||||
|
||||
Loading…
Reference in new issue