优酷视频地址:
百度网盘地址:
视频 Show notes:
Spacemacs Rocks Season 2 (Day 14)
Topic: File and Buffer operations
Talk the difference between the configs of mine and spacemacs
File related operations
-
SPC p f(find a file in current project, it looks like the Ctrl-p plugin in Vim)
I also do some hacks to enhance the SPC p f
(defun zilongshanren/open-file-with-projectile-or-counsel-git ()
(interactive)
(if (zilongshanren/vcs-project-root)
(counsel-git)
(if (projectile-project-p)
(projectile-find-file)
(ido-find-file))))
If it is in a Git repository, I use counsel-git to find file. Why not projectile? Becuase I think ivy-mode is much faster.
If it is in a proctile project, say it has a .projectile file in your project’s root.
Otherwise, you ido-find-file
-
SPC f fto find a file start from the current directory -
SPC f Lfind the file across the whole Mac system -
SPC f lfind file literally(I also enhance this func with ffap) -
SPC f hfind file in hex mode(I also enhance this func with ffap) -
SPC f oopen with external program -
SPC f Esudo edit -
SPC f Ddelete current file and buffer -
SPC f jopen the current file’s dired mode -
SPC f rfind the recent file with ivy -
SPC f Rrename the current file -
SPC f vadd local variables -
SPC f yyank current buffer’s full path -
SPC f a dfind the current visited directory with fasd. -
SPC f C d/uconvert file encoding between unix and dos -
SPC f e dfind the .spacemacs/.spacemacs.d/init.el file -
SPC f e ifind the .emacs/.emacs.d/init.el init file -
SPC f e lhelm locate library file -
SPC f ccopy file -
SPC f bshow bookmarks -
SPC f s/Ssave buffers
buffer related operations
-
SPC b .buffer micro state (hydra) -
SPC b bswitch buffers, i rebind it toivy-switch-buffer, because I could see recent use file in buffer -
SPC b dkill a buffer -
SPC b ffind buffer file in finder -
SPC b B/iI bind it to ibuffer -
SPC b hgo to home -
SPC b kkill matching buffers -
SPC b Nnew empty buffer -
SPC b mkill others -
SPC b Rsafe revert buffer -
SPC b sswitch to scratch buffer -
SPC b wtoggle buffer read-only -
SPC b Ycopy the whole buffer to clipboard, the content could be used in other programs -
SPC b Ppaste to the whole buffer -
SPC <tab>switch between the current buffer and the last opened buffer
Sometimes I also use the Dired mode to do all the files operations
I think I have talked about it in the previous videos.