Added sudo for zsh, added ;;<Space> for insert mode

This commit is contained in:
Austen Adler 2015-04-08 11:19:35 -04:00
parent 1903def20d
commit a3fd73813f
3 changed files with 25 additions and 1 deletions

View File

@ -269,6 +269,7 @@ source /home/stonewareslord/git/sync/zsh/theme-and-appearance.zsh
source /home/stonewareslord/git/sync/zsh/completion.zsh
source /home/stonewareslord/git/sync/zsh/key-bindings.zsh
source /home/stonewareslord/git/sync/zsh/spectrum.zsh
source /home/stonewareslord/git/sync/zsh/sudo.zsh
#source /home/stonewareslord/git/sync/zsh/misc.zsh
#source /home/stonewareslord/git/sync/zsh/history.zsh

View File

@ -106,7 +106,7 @@ inoremap {} <Right>{}<Left><CR><Esc>O
inoremap {% {% %}<Left><Left><Left>
inoremap [] []<Left>
inoremap ;; <Esc>m`A;<Esc>``a
"inoremap ;;<Space> <Esc>A;<Esc>o
inoremap ;;<Space> <Esc>A;<Esc>o
"nnoremap ;; m"A;<Esc>`"
"nnoremap ;;<Space> A;<Esc>o
inoremap <C-l> <Right>
@ -331,6 +331,8 @@ Plug 'vim-scripts/DirDiff.vim'
"Directory diff | https://github.com/vim-scripts/DirDiff.vim
Plug 'vim-scripts/DoxygenToolkit.vim'
"Doxygen | https://github.com/vim-scripts/DoxygenToolkit.vim
Plug 'vim-scripts/SyntaxRange'
"Range of syntaxes | https://github.com/vim-scripts/SyntaxRange
"DO NOT DELETE LINE ABOVE OR \bun WILL BREAK
call plug#end()
filetype plugin indent on

21
zsh/sudo.zsh Normal file
View File

@ -0,0 +1,21 @@
# ------------------------------------------------------------------------------
# Description
# -----------
#
# sudo will be inserted before the command
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Dongweiming <ciici123@gmail.com>
#
# ------------------------------------------------------------------------------
sudo-command-line() {
[[ -z $BUFFER ]] && zle up-history
[[ $BUFFER != sudo\ * ]] && LBUFFER="sudo $LBUFFER"
}
zle -N sudo-command-line
# Defined shortcut keys: [Esc] [Esc]
bindkey "\e\e" sudo-command-line