Skip to content

Instantly share code, notes, and snippets.

@killercup
Last active April 12, 2022 03:43
Show Gist options
  • Save killercup/5459372 to your computer and use it in GitHub Desktop.
Save killercup/5459372 to your computer and use it in GitHub Desktop.
Server Config with fish, vim an tmux
# ~/.config/fish/config.fish
. ~/.config/fish/fish_prompt.fish
set fish_greeting '' # turn off greeting
function fish_title;end
alias vi 'vim'
# Exports
set -x LC_ALL en_US.UTF-8
set -x LANG en_US.UTF-8
set -x LANGUAGE en_US.UTF-8
# Set the default prompt command. Make sure that every terminal escape
# string has a newline before and after, so that fish will know how
# long it is.
function fish_prompt --description "Write out the prompt"
# Just calculate these once, to save a few cycles when displaying the prompt
#if not set -q __fish_prompt_hostname
# set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
#end
if not set -q __fish_prompt_normal
set -g __fish_prompt_normal (set_color normal)
end
if not set -q __fish_prompt_cwd
set -g __fish_prompt_cwd (set_color $fish_color_cwd)
end
printf '%s%s:%s%s%s ' (set_color -b 'white' 'black') $USER "$__fish_prompt_cwd" (prompt_pwd) "$__fish_prompt_normal"
end
# ~/.tmux.conf
set-option -g default-shell /usr/local/bin/fish
set -g default-terminal "screen-256color"
setw -g automatic-rename off
setw -g mode-keys vi
setw -g mode-mouse on
unbind C-b
set -g prefix C-a
# resize panes like vim
bind-key -r < resize-pane -L 3
bind-key -r > resize-pane -R 3
bind-key -r + resize-pane -U 1
bind-key -r = resize-pane -D 1
# move between panes
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
# Statusbar settings
# toggle statusbar
bind-key s set status
# use vi-style key bindings in the status line
set -g status-keys vi
# amount of time for which status line messages and other indicators
# are displayed. time is in milliseconds.
set -g display-time 2000
# default statusbar colors
set -g status-fg white
set -g status-bg default
set -g status-attr dim
set -g status-interval 1
#
# default window title colors
setw -g window-status-fg white
#setw -g window-status-bg default
setw -g window-status-attr dim
# active window title colors
setw -g window-status-current-fg cyan
#setw -g window-status-current-bg default
#setw -g window-status-current-attr bright
setw -g window-status-current-attr underscore
# command/message line colors
set -g message-fg white
set -g message-bg black
set -g message-attr bright
set -g pane-active-border-fg blue
set -g pane-border-fg white
" ~/.vimrc
filetype plugin indent on
set nocompatible
set modelines=0
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set encoding=utf-8
set scrolloff=3
set autoindent
set showmode
set showcmd
set hidden
set wildmenu
set wildmode=list:longest
set visualbell
" set cursorline
set ttyfast
set ruler
set backspace=indent,eol,start
set laststatus=2
set relativenumber
set noswapfile
set nobackup
set nowb
nnoremap / /\v
vnoremap / /\v
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
nnoremap <leader><space> :noh<cr>
nnoremap <tab> %
vnoremap <tab> %
syntax on
set mouse=
" restore previous terminal content after quit
let &t_ti = "\<Esc>[?47h"
let &t_te = "\<Esc>[?47l"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment