rtorr / vim-cheat-sheet Goto Github PK
View Code? Open in Web Editor NEWA mobile friendly Vim cheat sheet
Home Page: http://vim.rtorr.com/
License: MIT License
A mobile friendly Vim cheat sheet
Home Page: http://vim.rtorr.com/
License: MIT License
Though not a basic command, but :w !sudo tee %
is quite useful on Ubuntu.
Also some pseudo-commands are important but a hidden trick to newbie, such as 'enable line-no', 'enable syntax-highlight', 'change file type'... Maybe a new section is needed to include them.
Just depends on you. ╮(‾▽‾)╭
Do you think it would be useful to add a table of content at the top of the page ? This would provide a general overview, as well a quick access to specific sections.
After building, I've found that my dist/index.html has google code.
It is not very good for local stored content...
It would be useful to add the ; (semicolon) and , (comma) commands, which respectively repeat the last f, F, t or T movement, or repeat it backwards. Thanks.
CTRL + wh move cursor to next window (right)
CTRL + wl move cursor to previous window (left)
I'm just starting to understand and get past overwhelm, and this is the perfect next step to help remembering!
J (shift+j) joins the current line with the next (deletes the newline chracter)
Also a description that preceding a command with a number repeats it. 4J combines four lines. 8x cuts the next 8 characters..
You can also type just :qa
to close all tabs without saving.
Everything needs a dark theme.
And it`s couple lines of css and js
The "gd" command can be quite useful and could be added on the cheat sheet
I think it should be "xp
, but I don't know which part of the repository to change, so I can't do a pull request.
Please, can you publish the last changes in gh-pages?
Thanks
I'd love to print out this page and stick on the wall in front of my desk. It'd be great to have a nice printer friendly version of the page.
I'll work on a pull request when I get the chance.
I noticed that the descriptions for ctrl + f/d/u
are not being rendered.
Same issue in every language. I can't see an obvious issue with the template that would cause this. Happens when checked out and run locally.
Thanks for the cheatsheet, printing it out and being able to write on it was a huge help to me in my first few days.
When I follow the instruction to build the site locally, I have an error:
$ bundle install ✔ 7812 14:40:37
Fetching gem metadata from https://rubygems.org/............
Fetching i18n 0.7.0
Installing i18n 0.7.0
Fetching json 1.8.1
Installing json 1.8.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.5.0/gems/json-1.8.1/ext/json/ext/generator
/usr/local/opt/ruby/bin/ruby -r ./siteconf20180927-61203-1phyq4b.rb extconf.rb
creating Makefile
current directory: /usr/local/lib/ruby/gems/2.5.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR=" clean
current directory: /usr/local/lib/ruby/gems/2.5.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:
./../fbuffer/fbuffer.h:175:47: error: too few arguments provided to function-like macro invocation
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
^
/usr/local/Cellar/ruby/2.5.1/include/ruby-2.5.0/ruby/intern.h:773:9: note: macro 'rb_str_new' defined
here
#define rb_str_new(str, len) RB_GNUC_EXTENSION_BLOCK( \
^
In file included from generator.c:1:
./../fbuffer/fbuffer.h:175:11: warning: incompatible pointer to integer conversion initializing 'VALUE'
(aka 'unsigned long') with an expression of type 'VALUE (const char *, long)' (aka 'unsigned long
(const char *, long)') [-Wint-conversion]
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
^ ~~~~~~~~~~
...
I didn't sent the whole log but I could put it on https://pastebin.com if needed.
Here is my configuration:
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]
I guess this could be helpful to vim learners.
Hi @rtorr
I just wanted to mention that I plan to use your vim-cheat-sheet to produce an (open source) instant answer for duckduckgo. I have no idea if Duck Duck Go will accept my pull request. Since you have an MIT license on your work I presume this is ok with you. I will let you know if this plan goes anywhere.
I started using the website as I learn how to use vim. I keep getting confused on whether the hotkey is O or 0. A different font might help; a zero will have a slash or dot in the middle. O will just be a circle.
This could just be my problem; but there is a chance other users go through this as well.
In the cursor movement section, consider adding "gj" and "gk" to visually move down and up respectively.
Thanks!
Thanks for making and maintaining the cheatsheet. As a beginner to Vim, I found this is very helpful.
I would like to add two commands for switching cases.
gU for switching to the uppercase.
gu for switching to the lowercase.
Thanks.
1p
put (paste) in next new line
1P
put (paste) in above new line
Hi!
I've just noticed that the wonderful Vim Cheatsheet has no favicon. It's a little annoying, when I have a tab with it pinned in my browser. As far as I know, vim's icon is GPL-licensed, so it can't be used in MIT-licensed project (please correct me if I am wrong). But there is, for example vim-replacement-icon (https://github.com/jasonlong/vim-replacement-icon) available, which should be fine.
I'm a bit of a newbie at Vim (though I've been using it for about 11 years on-and-off). I've been following http://vimcasts.org and want to learn to navigate text as effectively as is done in that video series (i.e. not taking my hands off the keyboard, and navigating via motions as much as possible), hence this cheat sheet is very helpful; thank you.
From watching the pros do it, it seems that a few useful commands to add to the cheat sheet might be these…
Though I know that deciding what's 'in' and what's 'out' mustn't be easy, I feel that these would help me keep my hands on the keyboard (and also not just falling back to using the hjkl 'arrow' keys).
I'd be happy to have a go at making a patch to include these, if you feel they should be included.
c$ could be replaced with a capital c, which als changes until end of line.
Of course you can use 1G
but gg
, in the same vein as yy
or dd
, is much faster as it uses only 2 keypresses. I frequently find myself jumping to the top of a document so this has helped me a lot so far.
There's already zz
, which position current line in the center of a page. Similarly, zt
and zb
position current line to the top or bottom respectively.
Shouldn't the first line under the "Tabs" header be
:tabnew or :tabnew file - open a file in a new tab
instead of
:tabnew or :tabn file - open a file in a new tab
?
I believe :tabn
is short for :tabnext
.
Really useful, mobile-friendly page, thx.
Would it be possible to update the hosted page at https://vim.rtorr.com/?
Looking at what's been committed and the view embedded at DuckDuckGo, vim.rtorr.com appears somewhat behind and I'd really like to tap into that reference without having to fork and self host (though now I know there's a DDG instant answer 😉 )
Perhaps a CD pipeline would help?
I believe that adding some commands for tabs/buffers would not hurt.
How do you feel about it?
Exiting section should have 'ZZ' for "write (save) and quit" as well as 'ZQ' for "quit and throw away unsaved changes"
Maybe add or edit a section for working with whole lines, paragraphs, etc.
gwip
could be expanded to gw, gww, gq, gqq
Or, at least have more in the description of what gwip
does, instead of just saying that it reflows the paragraph.
5gg goes to the 5th line - it is equivalent to 5G and, in my opinion, more practical.
Kudos for your job!
I noticed that queries for ctrl + f/d/u
are missing in src/templates/sheet.js
. This seems to cause a bug similar to #253, command descriptions are missing for pages under
vim.rtorr.com/lang/
.
There are some useful commands:
:ba[ll]
- edit all buffers as horizontal windows;<%
- de-indent a block with () or {} (cursor on brace);:mak[e]
- execute external command makeprg
and parse error messages. It's like exiting Vim, executing make
in terminal, and reopening the file(s), but with error logs in the quickfix window;g?
- Rot13 encode up to motion. I'm not sure this command is useful.There are other flags for the :s[ubstitude]
command:
:%s[ubstitute]/old/new
- replace all "old" first occurrences within lines with "new" throughout file:%s[ubstitute]/old/new/i
- replace all "old" first occurrences within lines with "new" throughout file (ignore case)Also one can use different ranges, not only "%" which means the entire buffer:
:12,26s/old/new/g
- replace all "old" with "new" from 12th to 26th lines inclusively;:31s/old/new/g
- replace all "old" with "new" in the 31st line;:s/old/new/g
- replace all "old" with "new" in the line under the cursor.These ranges may be used for other commands (e. g. :d
, :>
, etc.).
I guess a new section 'repeating tasks' could be helpful. move the '.' command to this section and add the command 'q_letter_ task q', which starts recording together with [number]@letter, which repeats the recording [number] times.
Do you consider adding the content in Markdown for those who would like to format and print it for themselves?
Thanks .. This is by far the nicest format
Firstly, this is a great cheat sheet! Thanks!
I tried to print it so I can keep it on my desk, but it's not very printer friendly so it all gets shoved into a single six page long column. What do you think of a printer friendly version?
Awesome resource. Please update the cheatsheet to add jumping to the last edit ...
I really like the cheatsheet, it's saved me loads of time while getting to know vim.
One thing I did still have to google though was how to remove the highlighting of matches following a search. The easiest answer seems to be to use :noh - is this something you would consider worth adding to the cheatsheet, presumably under the 'Search and replace' section? I'm happy to make the changes myself if you're accepting PRs.
Hey,
In editing part you should add the U
command which undo every changes made to the current line.
Regards
I would like add note about K
command (view man pages). But I doubt which section to add.
Searching for a term in multiple files within the project is a very useful feature, especially when we need to refactor code.
The syntax for the :vimgrep
command as well as :cn
, :cp
and :copen
could be included in the cheat sheet, to provide instruction about how to search and navigate the results.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.