Last active
October 8, 2025 13:24
-
-
Save romainl/3e0cb99343c72d04e9bc10f6d76ebbef to your computer and use it in GitHub Desktop.
Revisions
-
romainl revised this gist
Oct 8, 2025 . 2 changed files with 7 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Automatic file marks File marks are like regular marks except that they are associated with a specific *file*, which makes them pretty useful for quick file navigation. One use that is commonly mentionned would be to add a `V` mark to one's `vimrc`, for example, which would make editing it only one `'V` away. Here, a mnemonic mark is left when leaving files of a specific kind: @@ -16,4 +16,8 @@ This is very handy in long sessions where you edit lots of filetypes. --- This was initially ***VERY*** influenced by another one I found online, circa 2011-12. I didn't bookmark it at the time, though. I have posted my own version in various forums over the years but I could never point people to the actual original and give credit where credit is due. If you know where to find it I would gladly link to it. --- [My Vim-related gists](https://gist.github.com/romainl/4b9f139d2a8694612b924322de1025ce). This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,4 +7,5 @@ augroup AutomaticMarks autocmd BufLeave *.yml,*.yaml normal! mY autocmd BufLeave .env* normal! mE autocmd BufLeave *.md normal! mM " add your own! augroup END -
romainl revised this gist
Apr 28, 2023 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Automatic file marks File marks are like regular marks except that they are associated to a specific *file*, which makes them pretty useful for quick file navigation. One use that is commonly mentionned would be to add a `V` mark to one's `vimrc`, for example, which would make editing it only one `'V` away. Here, a mnemonic mark is left when leaving files of a specific kind: -
romainl revised this gist
Apr 2, 2023 . 2 changed files with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ # Automatic file marks File marks are like regular marks except that they are associated to a specific *file*, which make them pretty useful for quick file navigation. One use taht is commonly mentionned would be to add a `V` mark to one's `vimrc`, for example, which would make editing it only one `'V` away. Here, a mnemonic mark is left when leaving files of a specific kind: File renamed without changes. -
romainl created this gist
Apr 2, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ File marks are like regular marks except that they are associated to a specific *file*, which make them pretty useful for quick file navigation. One use taht is commonly mentionned would be to add a `V` mark to one's `vimrc`, for example, which would make editing it only one `'V` away. Here, a mnemonic mark is left when leaving files of a specific kind: - mark `C` for "CSS" and "SCSS", - mark `H` for "HTML", - etc. which makes it super easy to jump back to the last file of a certain kind that was edited: 'E This is very handy in long sessions where you edit lots of filetypes. --- This was initially ***VERY*** influenced by another one I found online, circa 2011-12. I didn't bookmark it at the time, though. I have posted my own version in various forums over the years but I could never point people to the actual original and give credit where credit is due. If you know where to find it I would gladly link to it. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ augroup AutomaticMarks autocmd! autocmd BufLeave *.css,*.scss normal! mC autocmd BufLeave *.html normal! mH autocmd BufLeave *.js,*.ts normal! mJ autocmd BufLeave *.vue normal! mV autocmd BufLeave *.yml,*.yaml normal! mY autocmd BufLeave .env* normal! mE autocmd BufLeave *.md normal! mM augroup END