脱离鼠标党

391 阅读3分钟

脱离鼠标党

以下插件操作快捷键都是按照vim习惯

文件管理Ranger安装

sudo apt-get install ranger

screenshot.png

生成配置

ranger --copy-config=all

修改ranger别名

echo "alias ranger='rg'" >> ~/.zshrc

安装lazygit

#go安装
git clone https://github.com/jesseduffield/lazygit.git
cd lazygit
go install
#brew安装
brew install lazygit

修改lazygit别名

 echo "alias lg='lazygit'" >> ~/.zshrc

staging.gif

lg #打开lazygit
a  #git add . 再次点击会取消add
space #可以单个选择提交文件
c   # git commit -m ""
d # 撤销更改
D # 撤销更改列表
n #添加分支
P # git push 
M #合并代码

安装Neovim

#brew 
brew install neovim
#ubuntu
sudo apt-get install neovim

安装vim-plug插件管理

curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  • ~/.config/nvim/init.vim中最开始的地方添加如下的内容
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree'
call plug#end()
  • 安装插件指令
:PlugInstall
  • 修改vim替代nvim
 echo alias vim=nvm >> ~/.zshrc
 source ~/.zshrc

Chrome插件Cvim

Keybindings

MovementMapping name
j, sscroll downscrollDown
k, wscroll upscrollUp
hscroll leftscrollLeft
lscroll rightscrollRight
dscroll half-page downscrollPageDown
unmappedscroll full-page downscrollFullPageDown
u, escroll half-page upscrollPageUp
unmappedscroll full-page upscrollFullPageUp
ggscroll to the top of the pagescrollToTop
Gscroll to the bottom of the pagescrollToBottom
0scroll to the left of the pagescrollToLeft
$scroll to the right of the pagescrollToRight
#reset the scroll focus to the main pageresetScrollFocus
gigo to first input boxgoToInput
gIgo to the last focused input box by gigoToLastInput
zzcenter page to current search match (middle)centerMatchH
ztcenter page to current search match (top)centerMatchT
zbcenter page to current search match (bottom)centerMatchB
Link Hints
fopen link in current tabcreateHint
Fopen link in new tabcreateTabbedHint
unmappedopen link in new tab (active)createActiveTabbedHint
Wopen link in new windowcreateHintWindow
Arepeat last hint commandopenLastHint
qtrigger a hover event (mouseover + mouseenter)createHoverHint
Qtrigger a unhover event (mouseout + mouseleave)createUnhoverHint
mfopen multiple linkscreateMultiHint
unmappededit text with external editorcreateEditHint
unmappedcall a code block with the link as the first argumentcreateScriptHint(<FUNCTION_NAME>)
unmappedopens images in a new tabfullImageHint
mrreverse image search multiple linksmultiReverseImage
myyank multiple links (open the list of links with P)multiYankUrl
gycopy URL from link to clipboardyankUrl
grreverse image search (google images)reverseImage
;change the link hint focus
QuickMarks
M<*>create quickmark <*>addQuickMark
go<*>open quickmark <*> in the current tabopenQuickMark
gn<*>open quickmark <*> in a new tabopenQuickMarkTabbed
gw<*>open quickmark <*> in a new windowopenQuickMarkWindowed
Miscellaneous
aalias to ":tabnew google ":tabnew google
.repeat the last commandrepeatCommand
:open command baropenCommandBar
/open search baropenSearchBar
?open search bar (reverse search)openSearchBarReverse
unmappedopen link search bar (same as pressing /?)openLinkSearchBar
Isearch through browser history:history
<N>g%scroll percent down the pagepercentScroll
<N>unmappedpass <N> keys through to the current pagepassKeys
ienter insert mode (escape to exit)insertMode
rreload the current tabreloadTab
gRreload the current tab + local cachereloadTabUncached
;<*>create mark <*>setMark
''go to last scroll positionlastScrollPosition
<C-o>go to previous scroll positionpreviousScrollPosition
<C-i>go to next scroll positionnextScrollPosition
'<*>go to mark <*>goToMark
cmmute/unmute a tabmuteTab
nonereload all tabsreloadAllTabs
crreload all tabs but currentreloadAllButCurrent
zizoom page inzoomPageIn
zozoom page outzoomPageOut
z0zoom page to original sizezoomOrig
z<Enter>toggle image zoom (same as clicking the image on image-only pages)toggleImageZoom
gdalias to :chrome://downloads:chrome://downloads
gealias to :chrome://extensions:chrome://extensions
yycopy the URL of the current page to the clipboardyankDocumentUrl
yYcopy the URL of the current frame to the clipboardyankRootUrl
yacopy the URLs in the current windowyankWindowUrls
yhcopy the currently matched text from find mode (if any)yankHighlight
bsearch through bookmarks:bookmarks
popen the clipboard selectionopenPaste
Popen the clipboard selection in a new tabopenPasteTab
gjhide the download shelfhideDownloadsShelf
gfcycle through iframesnextFrame
gFgo to the root framerootFrame
gqstop the current tab from loadingcancelWebRequest
gQstop all tabs from loadingcancelAllWebRequests
gugo up one path in the URLgoUpUrl
gUgo to to the base URLgoToRootUrl
gsgo to the view-source:// page for the current Url:viewsource!
<C-b>create or toggle a bookmark for the current URLcreateBookmark
unmappedclose all browser windowsquitChrome
g-decrement the first number in the URL path (e.g www.example.com/5 => www.example.com/4)decrementURLPath
g+increment the first number in the URL pathincrementURLPath
Tab Navigation
gt, K, Rnavigate to the next tabnextTab
gT, J, Enavigate to the previous tabpreviousTab
g0, g$go to the first/last tabfirstTab, lastTab
<C-S-h>, ghopen the last URL in the current tab's history in a new tabopenLastLinkInTab
<C-S-l>, glopen the next URL from the current tab's history in a new tabopenNextLinkInTab
xclose the current tabcloseTab
gxTclose the tab to the left of the current tabcloseTabLeft
gxtclose the tab to the right of the current tabcloseTabRight
gx0close all tabs to the left of the current tabcloseTabsToLeft
gx$close all tabs to the right of the current tabcloseTabsToRight
Xopen the last closed tablastClosedTab
t:tabnew:tabnew
T:tabnew :tabnew @%
O:open :open @%
<N>%switch to tab goToTab
H, Sgo backgoBack
L, Dgo forwardgoForward
Bsearch for another active tab:buffer
<move current tab leftmoveTabLeft
>move current tab rightmoveTabRight
]]click the "next" link on the page (see nextmatchpattern above)nextMatchPattern
[[click the "back" link on the page (see previousmatchpattern above)previousMatchPattern
gppin/unpin the current tabpinTab
<C-6>toggle the focus between the last used tabslastUsedTab
Find Mode
nnext search resultnextSearchResult
Nprevious search resultpreviousSearchResult
venter visual/caret mode (highlight current search/selection)toggleVisualMode
Venter visual line mode from caret mode/currently highlighted searchtoggleVisualLineMode
unmappedclear search mode highlightingclearSearchHighlight
Visual/Caret Mode
<Esc>exit visual mode to caret mode/exit caret mode to normal mode
vtoggle between visual/caret mode
h, j, k, lmove the caret position/extend the visual selection
ycopys the current selection
nselect the next search result
Nselect the previous search result
popen highlighted text in current tab
Popen highlighted text in new tab
Text boxes
<C-i>move cursor to the beginning of the linebeginningOfLine
<C-e>move cursor to the end of the lineendOfLine
<C-u>delete to the beginning of the linedeleteToBeginning
<C-o>delete to the end of the linedeleteToEnd
<C-y>delete back one worddeleteWord
<C-p>delete forward one worddeleteForwardWord
unmappeddelete back one characterdeleteChar
unmappeddelete forward one characterdeleteForwardChar
<C-h>move cursor back one wordbackwardWord
<C-l>move cursor forward one wordforwardWord
<C-f>move cursor forward one letterforwardChar
<C-b>move cursor back one letterbackwardChar
<C-j>move cursor forward one lineforwardLine
<C-k>move cursor back one linebackwardLine
unmappedselect input text (equivalent to <C-a>)selectAll
unmappededit with Vim in a terminal (need the cvim_server.py script running for this to work and the VIM_COMMAND set inside that script)editWithVim

Command Mode

CommandDescription
:tabnew (autocomplete)open a new tab with the typed/completed search
:new (autocomplete)open a new window with the typed/completed search
:open (autocomplete)open the typed/completed URL/google search
:history (autocomplete)search through browser history
:bookmarks (autocomplete)search through bookmarks
:bookmarks / (autocomplete)browse bookmarks by folder/open all bookmarks from folder
:set (autocomplete)temporarily change a cVim setting
:chrome:// (autocomplete)open a chrome:// URL
:tabhistory (autocomplete)browse the different history states of the current tab
:command <NAME> <ACTION>aliases :<NAME> to :<ACTION>
:quitclose the current tab
:qallclose the current window
:restore (autocomplete)restore a previously closed tab (newer versions of Chrome only)
:tabattach (autocomplete)move the current tab to another open window
:tabdetachmove the current tab to a new window
:file (autocomplete)open a local file
:source (autocomplete)load a cVimrc file into memory (this will overwrite the settings in the options page if the localconfig setting had been set previously
:duplicateduplicate the current tab
:settingsopen the settings page
:nohlsearchclear the highlighted text from the last search
:executeexecute a sequence of keys (Useful for mappings. For example, "map j :execute 2j")
:buffer (autocomplete)change to a different tab
:mksessioncreate a new session from the current tabs in the active window
:delsession (autocomplete)delete a saved session
:session (autocomplete)open the tabs from a saved session in a new window
:scriptrun JavaScript on the current page
:togglepintoggle the pin state of the current tab
:pintabpin the current tab
:unpintabunpin the current tab