Coder Social home page Coder Social logo

vim-cheat-sheet's Introduction

vim-cheat-sheet

Yet another vim cheat sheet.

http://vim.rtorr.com/

❤️ Sponsor

Set up for development

  1. Start app.
    npm ci
    npm start
  2. Open http://localhost:3000/ in browser.
  3. Edit sheet.hbs as desired (e.g. add new commands).
  4. Reload page in browser (Ctrl+r) to generate the locales entries in English en_us.json.
  5. Stop the app (optional).
  6. Describe the added commands in English en_us.json and move them to the corresponding position, equally as in sheet.hbs.
  7. Run node postinstall.js to copy the English entries to all other locales.
  8. Translate all languages you know.
  9. Commit.

vim-cheat-sheet's People

Contributors

athosmoreno avatar atommclain avatar benhuds avatar budmc29 avatar cascer1 avatar crazymaster avatar cuter44 avatar dependabot[bot] avatar dwaxe avatar dwettstein avatar freebsdfan avatar kablamo avatar ksiminski avatar maanijou avatar magdalenajadach avatar marioliebel avatar martindelille avatar merlinschumacher avatar mildronize avatar moritzreiter avatar nixsm avatar nl5887 avatar oidz1234 avatar puttla1 avatar rtorr avatar rumia-san avatar talayhan avatar tenx-s avatar vitorleal avatar vladviolentiy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-cheat-sheet's Issues

some items "impossible" to translate

captura de tela 21
some items that cannot be edited on the html file on lang are shown in english on the site.

I don't know what could be done, but I felt that should be reported.

Arabic translation isn't complete

I checked the Arabic translation and it is not complete. Are you okay with me submitting a PR to replace the missing stuff?

Screenshot

arabic

Page navigation commands not rendered

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.

Screenshot 2019-04-06 at 12 32 18
Screenshot 2019-04-06 at 12 32 06

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.

Suggestions for inclusion: f and t; text-object motions and the very-magic switch

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.

Printer Friendly Design

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.

Content in Markdown

Do you consider adding the content in Markdown for those who would like to format and print it for themselves?

Suggestion for include J and count

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..

recording

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.

Add dark theme

Everything needs a dark theme.
And it`s couple lines of css and js

Command descriptions are missing

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/.

Confusion between O and 0

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.

Example Font

This could just be my problem; but there is a chance other users go through this as well.

Add table of content

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.

Duck duck go instant answer

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.

Switching Cases

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.

:tabn file should be :tabnew file

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.

The French cheat sheet is not complete.

Two commands in the French sheet are still in English (Ctrl + wh and Ctrl + wl).
The issue
This is only a minor issue that I found, but the fixes would be:

  • Ctrl + wh: déplacer le curseur vers le prochain tampon.
  • Ctrl + wl: déplacer le curseur vers le tampon précédent.

Consider adding U

Hey,
In editing part you should add the U command which undo every changes made to the current line.
Regards

Removing search match highlighting

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.

Update vim.rtorr.com

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?

consider adding `zt` and `zb`

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.

Add "semicolon" and "comma" commands

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.

man pages from vim

I would like add note about K command (view man pages). But I doubt which section to add.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

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:

  • OS: macOS
  • ruby version (from https://brew.sh): ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin17]

Suggestion: Printer friendly version

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?

Include :vimgrep command to search in multiple files

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.

Thank you!

I'm just starting to understand and get past overwhelm, and this is the perfect next step to help remembering!

Exiting Shortcuts

Exiting section should have 'ZZ' for "write (save) and quit" as well as 'ZQ' for "quit and throw away unsaved changes"

c$ is the same as C

c$ could be replaced with a capital c, which als changes until end of line.

There is no favicon

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.

Paragraph/Line Flow

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.

Add some new commands

There are some useful commands:

  1. :ba[ll] - edit all buffers as horizontal windows;
  2. <% - de-indent a block with () or {} (cursor on brace);
  3. :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;
  4. g? - Rot13 encode up to motion. I'm not sure this command is useful.

There are other flags for the :s[ubstitude] command:

  1. :%s[ubstitute]/old/new - replace all "old" first occurrences within lines with "new" throughout file
  2. :%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:

  1. :12,26s/old/new/g - replace all "old" with "new" from 12th to 26th lines inclusively;
  2. :31s/old/new/g - replace all "old" with "new" in the 31st line;
  3. :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.).

suggest a 'write read-only file' command

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. ╮(‾▽‾)╭

5gg is missing

5gg goes to the 5th line - it is equivalent to 5G and, in my opinion, more practical.
Kudos for your job!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.