优酷视频地址:
百度网盘地址:
视频 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 f
to find a file start from the current directory -
SPC f L
find the file across the whole Mac system -
SPC f l
find file literally(I also enhance this func with ffap) -
SPC f h
find file in hex mode(I also enhance this func with ffap) -
SPC f o
open with external program -
SPC f E
sudo edit -
SPC f D
delete current file and buffer -
SPC f j
open the current file’s dired mode -
SPC f r
find the recent file with ivy -
SPC f R
rename the current file -
SPC f v
add local variables -
SPC f y
yank current buffer’s full path -
SPC f a d
find the current visited directory with fasd. -
SPC f C d/u
convert file encoding between unix and dos -
SPC f e d
find the .spacemacs/.spacemacs.d/init.el file -
SPC f e i
find the .emacs/.emacs.d/init.el init file -
SPC f e l
helm locate library file -
SPC f c
copy file -
SPC f b
show bookmarks -
SPC f s/S
save buffers
buffer related operations
-
SPC b .
buffer micro state (hydra) -
SPC b b
switch buffers, i rebind it toivy-switch-buffer
, because I could see recent use file in buffer -
SPC b d
kill a buffer -
SPC b f
find buffer file in finder -
SPC b B/i
I bind it to ibuffer -
SPC b h
go to home -
SPC b k
kill matching buffers -
SPC b N
new empty buffer -
SPC b m
kill others -
SPC b R
safe revert buffer -
SPC b s
switch to scratch buffer -
SPC b w
toggle buffer read-only -
SPC b Y
copy the whole buffer to clipboard, the content could be used in other programs -
SPC b P
paste 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.