Initial commit
This commit is contained in:
commit
44bef82d30
3
README.md
Normal file
3
README.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# linux-config
|
||||||
|
|
||||||
|
My collection of useful Linux configuration files.
|
31
bash/.bashrc.append
Normal file
31
bash/.bashrc.append
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
|
||||||
|
# customized
|
||||||
|
|
||||||
|
umask 077
|
||||||
|
|
||||||
|
export EDITOR='vim'
|
||||||
|
export VISUAL='vim'
|
||||||
|
|
||||||
|
# cool colored command prompt
|
||||||
|
|
||||||
|
PS1='${debian_chroot:+($debian_chroot)}\[\e[01;38;5;11m\]\u\[\e[00;38;5;208m\]@\[\e[01;38;5;27m\]\h\[\e[00m\]:\[\e[00;38;5;45m\]\w\[\e[0m\]\$ '
|
||||||
|
|
||||||
|
# Shows a oneline preview of all files under the folder after changing directory.
|
||||||
|
|
||||||
|
cd() {
|
||||||
|
builtin cd "$@" && ls -v -w $COLUMNS --color=always --format=commas --group-directories-first | head -n 1
|
||||||
|
}
|
||||||
|
|
||||||
|
pushd() {
|
||||||
|
builtin pushd "$@"
|
||||||
|
cd .
|
||||||
|
}
|
||||||
|
|
||||||
|
popd() {
|
||||||
|
builtin popd "$@"
|
||||||
|
cd .
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ -z "$TMUX" ] && [ "$PWD" == ~ ]; then
|
||||||
|
tmux new -As default
|
||||||
|
fi
|
2
git/git.sh
Executable file
2
git/git.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
git config --global alias.logtree 'log --all --graph --oneline --decorate'
|
||||||
|
git config --global core.pager 'less -x1,5'
|
1
permissions.sh
Executable file
1
permissions.sh
Executable file
@ -0,0 +1 @@
|
|||||||
|
chmod go-rwx -R ~
|
2
readline/.inputrc
Normal file
2
readline/.inputrc
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
$include /etc/inputrc
|
||||||
|
"\e[Z": menu-complete
|
30
tmux/.tmux.conf
Normal file
30
tmux/.tmux.conf
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
set -g default-terminal "xterm-256color"
|
||||||
|
set-window-option -g mode-keys vi
|
||||||
|
set -g prefix C-q
|
||||||
|
setw -g mouse on
|
||||||
|
set -g clock-mode-style 12
|
||||||
|
|
||||||
|
set-option -g history-limit 5000
|
||||||
|
set -sg escape-time 25
|
||||||
|
|
||||||
|
unbind Up
|
||||||
|
unbind Down
|
||||||
|
unbind Left
|
||||||
|
unbind Right
|
||||||
|
|
||||||
|
bind C-q send-prefix
|
||||||
|
bind S set status
|
||||||
|
# Reload with ctrl-r
|
||||||
|
bind r source-file ~/.tmux.conf \; display "Reloaded tmux config."
|
||||||
|
bind s setw synchronize-panes
|
||||||
|
|
||||||
|
bind _ split-window -v
|
||||||
|
bind | split-window -h
|
||||||
|
|
||||||
|
bind H split-window -f -h
|
||||||
|
bind V split-window -f -v
|
||||||
|
|
||||||
|
bind -r C-h select-pane -L
|
||||||
|
bind -r C-j select-pane -D
|
||||||
|
bind -r C-k select-pane -U
|
||||||
|
bind -r C-l select-pane -R
|
84
vim/.vimrc
Normal file
84
vim/.vimrc
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
" vim-plug
|
||||||
|
call plug#begin()
|
||||||
|
Plug 'chriskempson/base16-vim'
|
||||||
|
call plug#end()
|
||||||
|
|
||||||
|
colorscheme base16-default-dark
|
||||||
|
filetype plugin indent on
|
||||||
|
syntax on
|
||||||
|
|
||||||
|
autocmd CmdwinEnter * noremap <buffer> <CR> <CR>
|
||||||
|
autocmd FileType c,java set colorcolumn=81 textwidth=80
|
||||||
|
autocmd FileType markdown set ai spell colorcolumn=81 textwidth=80
|
||||||
|
autocmd FileType rust set noexpandtab
|
||||||
|
|
||||||
|
set encoding=utf-8
|
||||||
|
set termencoding=utf-8
|
||||||
|
set fileencodings=ucs-bom,utf-8,chinese
|
||||||
|
|
||||||
|
let mapleader=" "
|
||||||
|
nnoremap <space> <nop>
|
||||||
|
nnoremap Y y$
|
||||||
|
nnoremap <CR> :
|
||||||
|
vnoremap <CR> :
|
||||||
|
|
||||||
|
nnoremap <silent> <leader>f 1z=
|
||||||
|
nnoremap <silent> <leader>h :noh<CR>:echo "Stopped search highlighting."<CR>
|
||||||
|
nnoremap <silent> <leader>i :call ToggleIntuitiveLineMovement()<CR>
|
||||||
|
nnoremap <silent> <leader>l :set list!<CR>
|
||||||
|
nnoremap <silent> <leader>q gwap
|
||||||
|
nnoremap <silent> <leader>s :call ToggleSpellCheck()<CR>
|
||||||
|
nnoremap <silent> <leader>w :update<CR>
|
||||||
|
|
||||||
|
set backspace=indent,eol,start " powerful backspace
|
||||||
|
set complete+=kspell " dictionary completion
|
||||||
|
set cpo+=J " sentences are separated by two spaces
|
||||||
|
set display=lastline " show as much as possible when it doesn't fit
|
||||||
|
set hlsearch
|
||||||
|
set incsearch
|
||||||
|
set listchars=eol:$,tab:>-,trail:·
|
||||||
|
set mouse=a
|
||||||
|
set number
|
||||||
|
set relativenumber
|
||||||
|
set showcmd
|
||||||
|
set spelllang=en_us,cjk
|
||||||
|
|
||||||
|
hi Normal ctermfg=white ctermbg=none
|
||||||
|
hi Search ctermfg=yellow ctermbg=black
|
||||||
|
hi IncSearch ctermfg=black ctermbg=yellow
|
||||||
|
hi LineNr ctermfg=10 ctermbg=0
|
||||||
|
hi CursorLineNr ctermfg=12 ctermbg=0
|
||||||
|
hi Visual ctermfg=16 ctermbg=yellow
|
||||||
|
|
||||||
|
hi Pmenu ctermfg=NONE ctermbg=236
|
||||||
|
hi PmenuSel ctermfg=0 ctermbg=10
|
||||||
|
|
||||||
|
set tabstop=4
|
||||||
|
set shiftwidth=4
|
||||||
|
|
||||||
|
set timeout ttimeoutlen=25
|
||||||
|
|
||||||
|
function! ToggleSpellCheck()
|
||||||
|
set spell!
|
||||||
|
if &spell
|
||||||
|
echo "Spell check is now on."
|
||||||
|
else
|
||||||
|
echo "Spell check is now off."
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ToggleIntuitiveLineMovement()
|
||||||
|
if mapcheck("jk")==""
|
||||||
|
echo "Intuitive line movement is now on."
|
||||||
|
nnoremap j gj
|
||||||
|
nnoremap k gk
|
||||||
|
inoremap <down> <C-o>gj
|
||||||
|
inoremap <up> <C-o>gk
|
||||||
|
else
|
||||||
|
echo "Intuitive line movement is now off."
|
||||||
|
nunmap j
|
||||||
|
nunmap k
|
||||||
|
iunmap <down>
|
||||||
|
iunmap <up>
|
||||||
|
endif
|
||||||
|
endfunction
|
3
vim/vim-plug.sh
Executable file
3
vim/vim-plug.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
curl -Lo ~/.vim/autoload/plug.vim --create-dirs \
|
||||||
|
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
Loading…
Reference in New Issue
Block a user