Skip to content

Commit d7e0fc5

Browse files
committed
Cleaning up introductory vimsheet.
1 parent e1a9d01 commit d7e0fc5

File tree

2 files changed

+26
-71
lines changed

2 files changed

+26
-71
lines changed

css/base.css

+3
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,9 @@ h2 {
558558
border-bottom: 1px solid #eee;
559559
margin-bottom: 5px;
560560
}
561+
h3 {
562+
margin: 5px 0 0 0;
563+
}
561564

562565
pre {
563566
margin: 0 20px;

index.md

+23-71
Original file line numberDiff line numberDiff line change
@@ -127,87 +127,39 @@ Marks allow you to jump to designated points in your code.
127127
Vim is quite unpleasant out of the box. For example, typeing `:w` for every file save is awkward and copying and pasting to the system clipboard does not work. But a few changes will get you much closer to the editor of your dreams.
128128

129129
##.vimrc
130-
* [https://github.com/theicfire/dotfiles/blob/master/vim/.vimrc](https://github.com/theicfire/dotfiles/blob/master/vim/.vimrc)
131-
* Copy this to your home directory and restart vim. Read through it to see what you can now do (like `[space]w` to save a file)
132-
* mac users - making a hidden normal file is suprisingly tricky. Here’s one way:
133-
* in the command line, go to the home directory
134-
* type `nano .vimrc`
135-
* paste in the contents of the .vimrc file
136-
* `ctrl+x`, `y`, `[enter]` to save
137-
* This is a minimal vimrc that focuses on three priorities:
138-
* adding options that are strictly better (like more information showing in autocomplete)
139-
* more convenient keystrokes (like `[space]w` for write, instead of `:w [enter]`)
140-
* a similar workflow to normal text editors (like enabling the mouse)
141-
* You should now be able to press `[space]w` in normal mode to save a file. And `[space]p` to paste from outside of vim.
142-
* If you can’t paste, it’s probably because vim was not built with the system clipboard option. To check, run `vim --version` and see if `+clipboard` exists. If it says `-clipboard`, you will not be able to copy from outside of vim.
143-
* For mac users, homebrew does this right. Install homebrew and then run `brew install vim`.
144-
* then move the old vim binary: `$ mv /usr/bin/vim /usr/bin/vimold`
145-
* restart your terminal and you should see `vim --version` now with `+clipboard`
130+
* [My .vimrc file](https://github.com/theicfire/dotfiles/blob/master/vim/.vimrc) has some pretty great ideas I haven't seen elsewhere.
131+
* This is a minimal vimrc that focuses on three priorities:
132+
* adding options that are strictly better (like more information showing in autocomplete)
133+
* more convenient keystrokes (like `[space]w` for write, instead of `:w [enter]`)
134+
* a similar workflow to normal text editors (like enabling the mouse)
135+
136+
### Installation
137+
* Copy this to your home directory and restart vim. Read through it to see what you can now do (like `[space]w` to save a file)
138+
* mac users - making a hidden normal file is suprisingly tricky. Here’s one way:
139+
* in the command line, go to the home directory
140+
* type `nano .vimrc`
141+
* paste in the contents of the .vimrc file
142+
* `ctrl+x`, `y`, `[enter]` to save
143+
* You should now be able to press `[space]w` in normal mode to save a file.
144+
* `[space]p` should paste from the system clipboard (outside of vim).
145+
* If you can’t paste, it’s probably because vim was not built with the system clipboard option. To check, run `vim --version` and see if `+clipboard` exists. If it says `-clipboard`, you will not be able to copy from outside of vim.
146+
* For mac users, homebrew install vim with the clipboard option. Install homebrew and then run `brew install vim`.
147+
* then move the old vim binary: `$ mv /usr/bin/vim /usr/bin/vimold`
148+
* restart your terminal and you should see `vim --version` now with `+clipboard`
146149

147150
##Plugins
148-
* The easiest way to make vim more powerful is to use Vintageous in sublime (version 3). This gives you Vim mode inside sublime. I suggest this (or a similar setup with the Atom editor) if you aren't a vim master.
149-
* Vintageous is great, but there’s a few things you have to do to tame it.
150-
* Get the [current version](https://github.com/guillermooo/Vintageous) of Vintageous (I last used 3.5.1), and extract it to `~/.config/sublime-text-3/Packages/Vintageous` (or wherever the Packages directory is) (Do not use the package manager; we don’t want compiled python. We want to edit the python)
151-
* edit `Vintageous/Default.sublime-keymap`, and comment out (put `//` in front of lines) the references to certain useful shortcuts that you don’t want Vintageous to overwrite (first check each to see if it’s overwritten)
152-
* `ctrl+w` - close
153-
* `ctrl+s` - save
154-
* `tab` - indent
155-
* `ctrl+n` - new file
156-
* `ctrl+a` - select all
157-
* `ctrl+f` - find
158-
* `/` from vim also works, but it’s not as useful sometimes
151+
* The easiest way to make vim more powerful is to use Vintageous in sublime (version 3). This gives you Vim mode inside sublime. I suggest this (or a similar setup with the Atom editor) if you aren't a vim master. Check out [Advanced Vim](advanced.html) if you are.
152+
* Vintageous is great, but I suggest you change a few settings to make it better.
153+
* Clone [this repository](https://github.com/theicfire/Vintageous) to `~/.config/sublime-text-3/Packages/Vintageous`, or similar. Then check out the "custom" branch.
154+
* Alternatively, you can get a more updated Vintageous version by cloning [the official](https://github.com/guillermooo/Vintageous) repo and then copying over [this patch](https://github.com/theicfire/Vintageous/commit/19ff6311b01e3ae259b7eb8e3944687b42ba06ff).
159155
* Change the user settings (`User/Preferences.sublime-settings`) to include:
160156
* `"caret_style": "solid"`
161157
* This will make the cursor not blink, like in vim.
162158
* sublime might freeze when you do this. It’s a bug; just restart sublime after changing the file.
163-
* Change `Vintageous/Preferences.sublime-settings`, and change the following fields:
164-
* `"vintageous_use_ctrl_keys": true,`
165-
* `"vintageous_use_sys_clipboard": true,`
166-
* `"vintageous_reset_mode_when_switching_tabs": false,`
167-
* [https://github.com/guillermooo/Vintageous/pull/562/files](https://github.com/guillermooo/Vintageous/pull/562/files) will open new files in command mode, as expected
168159
* `ctrl+r` in vim means "redo". But there is a handy ctrl+r shortcut in sublime that gives an "outline" of a file. I remapped it to alt+r by putting this in the User keymap
169160
* `{ "keys": ["alt+r"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} },`
170161
* [Add the ability to toggle vintageous on and off](https://github.com/guillermooo/Vintageous/wiki/Toggling-Vintageous)
171162
* Mac users: you will not have the ability to hold down a navigation key (like holding j to go down). To fix this, run the commands specified here: [https://gist.github.com/kconragan/2510186](https://gist.github.com/kconragan/2510186)
172-
* Get sublime to not copy when highlighting and pasting (pressing p) by doing the following:
173-
* go into `sublime-text-3/Packages/Vintageos/actions.py` and comment out the line (and wrapping if statement) that says `state.registers['"'] = prev_text`. I bet there’s a better way to do this, but this seems to work.
174-
* recent work on Vintageous moved the file to xactions.py. It will probably change soon in the future. Here’s the diff of what I removed, so hopefully you can find the same diff in the future:
175-
176-
~~~~~~~
177-
--- a/xactions.py
178-
+++ b/xactions.py
179-
@@ -1542,9 +1542,9 @@ class _vi_big_p(ViTextCommandBase):
180-
fragments = state.registers['"']
181-
182-
- if state.mode == modes.VISUAL:
183-
+ #if state.mode == modes.VISUAL:
184-
# Populate registers with the text we're about to paste.
185-
- state.registers['"'] = prev_text
186-
+ # state.registers['"'] = prev_text
187-
188-
sels = list(self.view.sel())
189-
if len(sels) == len(fragments):
190-
@@ -1640,14 +1640,14 @@ class _vi_p(ViTextCommandBase):
191-
print("Vintageous: Nothing in register \".")
192-
return
193-
194-
- if state.mode == modes.VISUAL:
195-
- # force register population. We have to do it here
196-
- # vi_cmd_data = {
197-
- # "synthetize_new_line_at_eof": True,
198-
- # "yanks_linewise": False,
199-
- # }
200-
- prev_text = state.registers.get_selected_text(self)
201-
- state.registers['"'] = prev_text
202-
+ # if state.mode == modes.VISUAL:
203-
+ # # force register population. We have to do it here
204-
+ # # vi_cmd_data = {
205-
+ # # "synthetize_new_line_at_eof": True,
206-
+ # # "yanks_linewise": False,
207-
+ # # }
208-
+ # prev_text = state.registers.get_selected_text(self)
209-
+ # state.registers['"'] = prev_text
210-
~~~~~~~
211163

212164
* Now you should be able to restart sublime and have a great vim environment! Sweet Dude.
213165

0 commit comments

Comments
 (0)