mirror of
https://github.com/mhinz/vim-galore.git
synced 2025-04-03 19:49:28 +08:00
Compare commits
32 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
604f1a6f39 | ||
|
ffd73c57c1 | ||
|
5021813f96 | ||
|
582c81bdf3 | ||
|
3f250014cb | ||
|
412487cab6 | ||
|
3b872dd97a | ||
|
b1bcb6f60f | ||
|
b709246b74 | ||
|
8d897c0a17 | ||
|
2ad6c17ab8 | ||
|
b1a26b3135 | ||
|
d0bd3cf589 | ||
|
fa07baec6c | ||
|
b64abe3e6a | ||
|
058a090065 | ||
|
85489f9a7f | ||
|
8a4cb44704 | ||
|
2d476c1efb | ||
|
c6326fe2e2 | ||
|
363a74febd | ||
|
3235ef7479 | ||
|
4a25df91a3 | ||
|
4550a3af77 | ||
|
4fc7ac9755 | ||
|
a49607fc45 | ||
|
046b48f322 | ||
|
c079239172 | ||
|
765dcc6809 | ||
|
05ccf170ef | ||
|
83049cac26 | ||
|
8bc1efb762 |
@ -1,8 +0,0 @@
|
||||
sudo: false
|
||||
os: linux
|
||||
|
||||
language: go
|
||||
go: 1.8
|
||||
|
||||
install: go get github.com/mhinz/gomali
|
||||
script: gomali *.md
|
@ -2,73 +2,131 @@
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level of
|
||||
experience, nationality, personal appearance, race, religion, or sexual identity
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, caste, color, religion, or sexual identity
|
||||
and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at mh.codebro@gmail.com. All complaints
|
||||
will be reviewed and investigated and will result in a response that is deemed
|
||||
necessary and appropriate to the circumstances. The project team is obligated to
|
||||
maintain confidentiality with regard to the reporter of an incident. Further
|
||||
details of specific enforcement policies may be posted separately.
|
||||
reported to the community leaders responsible for enforcement at
|
||||
[INSERT CONTACT METHOD].
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
version 2.0, available at
|
||||
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
Community Impact Guidelines were inspired by
|
||||
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
|
||||
at [https://www.contributor-covenant.org/translations][translations].
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
|
||||
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||
[FAQ]: https://www.contributor-covenant.org/faq
|
||||
[translations]: https://www.contributor-covenant.org/translations
|
||||
|
37
PLUGINS.md
37
PLUGINS.md
@ -9,10 +9,12 @@
|
||||
- [Code completion](#code-completion)
|
||||
- [Commenters](#commenters)
|
||||
- [Cycle](#cycle)
|
||||
- [Databases](#databases)
|
||||
- [Delimiter](#delimiter)
|
||||
- [Fuzzy finders](#fuzzy-finders)
|
||||
- [Grep tools](#grep-tools)
|
||||
- [Indent](#indent)
|
||||
- [LSP](#lsp)
|
||||
- [Misc](#misc)
|
||||
- [Navigation](#navigation)
|
||||
- [Plugin managers](#plugin-managers)
|
||||
@ -39,6 +41,7 @@
|
||||
- [Lua](#lua)
|
||||
- [PHP](#php)
|
||||
- [Python](#python)
|
||||
- [Rust](#rust)
|
||||
- [TeX](#tex)
|
||||
- [VimL](#viml)
|
||||
|
||||
@ -49,6 +52,7 @@ Here's a list of commonly used colorschemes:
|
||||
- [acme-colors](https://github.com/plan9-for-vimspace/acme-colors)
|
||||
- [apprentice](https://github.com/romainl/Apprentice)
|
||||
- [base16](https://github.com/chriskempson/base16-vim)
|
||||
- [dracula](https://github.com/dracula/vim)
|
||||
- [gotham](https://github.com/whatyouhide/vim-gotham)
|
||||
- [gruvbox](https://github.com/morhetz/gruvbox)
|
||||
- [janah](https://github.com/mhinz/vim-janah)
|
||||
@ -56,7 +60,10 @@ Here's a list of commonly used colorschemes:
|
||||
- [lucius](https://github.com/jonathanfilip/vim-lucius)
|
||||
- [molokai](https://github.com/tomasr/molokai)
|
||||
- [nofrils](https://github.com/robertmeta/nofrils)
|
||||
- [nord](https://github.com/arcticicestudio/nord-vim)
|
||||
- [oceanic-next](https://github.com/mhartington/oceanic-next)
|
||||
- [oceanic-next](https://github.com/mhartington/oceanic-next)
|
||||
- [onedark](https://github.com/joshdick/onedark.vim)
|
||||
- [paramount](https://github.com/owickstrom/vim-colors-paramount)
|
||||
- [railscasts](https://github.com/jpo/vim-railscasts-theme)
|
||||
- [seoul256](https://github.com/junegunn/seoul256.vim)
|
||||
@ -106,6 +113,11 @@ or [Colortemplate](https://github.com/lifepillar/vim-colortemplate).
|
||||
- [tcomment_vim](https://github.com/tomtom/tcomment_vim)
|
||||
- [vim-commentary](https://github.com/tpope/vim-commentary)
|
||||
|
||||
#### Databases
|
||||
|
||||
- [pgsql.vim](https://github.com/lifepillar/pgsql.vim)
|
||||
- [vim-dadbod](https://github.com/tpope/vim-dadbod)
|
||||
|
||||
#### Delimiter
|
||||
|
||||
- [auto-pairs](https://github.com/jiangmiao/auto-pairs)
|
||||
@ -118,8 +130,8 @@ or [Colortemplate](https://github.com/lifepillar/vim-colortemplate).
|
||||
- [ctrlp.vim](https://github.com/ctrlpvim/ctrlp.vim)
|
||||
- [denite.nvim](https://github.com/Shougo/denite.nvim) (_requires +python3_)
|
||||
- [fzf](https://github.com/junegunn/fzf) (and [fzf.vim](https://github.com/junegunn/fzf.vim))
|
||||
- [LeaderF](https://github.com/Yggdroot/LeaderF) (_requires +python or +python3_)
|
||||
- [unite.vim](https://github.com/Shougo/unite.vim)
|
||||
- [vim-fz](https://github.com/mattn/vim-fz)
|
||||
|
||||
#### Grep tools
|
||||
|
||||
@ -132,6 +144,15 @@ or [Colortemplate](https://github.com/lifepillar/vim-colortemplate).
|
||||
- [indentLine](https://github.com/Yggdroot/indentLine)
|
||||
- [vim-indent-guides](https://github.com/nathanaelkane/vim-indent-guides)
|
||||
|
||||
#### LSP
|
||||
|
||||
Plugins for the [Language Server Protocol](https://microsoft.github.io/language-server-protocol)
|
||||
|
||||
- [coc.nvim](https://github.com/neoclide/coc.nvim)
|
||||
- [languageclient-neovim](https://github.com/autozimu/LanguageClient-neovim)
|
||||
- [vim-lsc](https://github.com/natebosch/vim-lsc)
|
||||
- [vim-lsp](https://github.com/prabirshrestha/vim-lsp)
|
||||
|
||||
#### Navigation
|
||||
|
||||
- [nerdtree](https://github.com/scrooloose/nerdtree)
|
||||
@ -222,12 +243,17 @@ Also see [fuzzy finders](#fuzzy-finders).
|
||||
- [vim-github-dashboard](https://github.com/junegunn/vim-github-dashboard)
|
||||
- [vim-lawrencium](https://bitbucket.org/ludovicchabant/vim-lawrencium)
|
||||
- [vim-signify](https://github.com/mhinz/vim-signify)
|
||||
- [vim-twiggy](https://github.com/sodapopcan/vim-twiggy)
|
||||
- [vimagit](https://github.com/jreybert/vimagit)
|
||||
|
||||
#### Writing
|
||||
|
||||
- [thesaurus_query.vim](https://github.com/ron89/thesaurus_query.vim)
|
||||
- [vim-grammarous](https://github.com/rhysd/vim-grammarous)
|
||||
- [vim-LanguageTool](https://github.com/dpelle/vim-LanguageTool)
|
||||
- [vim-online-thesaurus](https://github.com/beloglazov/vim-online-thesaurus)
|
||||
- [vim-textobj-quote](https://github.com/reedes/vim-textobj-quote)
|
||||
- [vim-wordy](https://github.com/reedes/vim-wordy)
|
||||
|
||||
#### Misc
|
||||
|
||||
@ -236,6 +262,7 @@ Also see [fuzzy finders](#fuzzy-finders).
|
||||
- [FastFold](https://github.com/Konfekt/FastFold)
|
||||
- [goyo.vim](https://github.com/junegunn/goyo.vim)
|
||||
- [is.vim](https://github.com/haya14busa/is.vim)
|
||||
- [limelight.vim](https://github.com/junegunn/limelight.vim)
|
||||
- [NrrwRgn](https://github.com/chrisbra/NrrwRgn)
|
||||
- [sideways.vim](https://github.com/AndrewRadev/sideways.vim)
|
||||
- [splitjoin.vim](https://github.com/AndrewRadev/splitjoin.vim)
|
||||
@ -267,6 +294,7 @@ Also see [fuzzy finders](#fuzzy-finders).
|
||||
- [color_coded](https://github.com/jeaye/color_coded)
|
||||
- [lh-cpp](https://github.com/LucHermitte/lh-cpp)
|
||||
- [vim-cpp-enhanced-highlight](https://github.com/octol/vim-cpp-enhanced-highlight)
|
||||
- [vim-rtags](https://github.com/lyuts/vim-rtags)
|
||||
|
||||
#### Clojure
|
||||
|
||||
@ -310,6 +338,7 @@ Also see [fuzzy finders](#fuzzy-finders).
|
||||
- [vim-flow](https://github.com/flowtype/vim-flow)
|
||||
- [vim-javascript-syntax](https://github.com/jelera/vim-javascript-syntax)
|
||||
- [vim-javascript](https://github.com/pangloss/vim-javascript)
|
||||
- [vim-jsx](https://github.com/mxw/vim-jsx)
|
||||
- [vim-node](https://github.com/moll/vim-node)
|
||||
- [vim-prettier](https://github.com/prettier/vim-prettier)
|
||||
- [yajs.vim](https://github.com/othree/yajs.vim)
|
||||
@ -336,6 +365,12 @@ Also see [fuzzy finders](#fuzzy-finders).
|
||||
- [SimpylFold](https://github.com/tmhedberg/SimpylFold)
|
||||
- [vim-flake8](https://github.com/nvie/vim-flake8)
|
||||
|
||||
#### Rust
|
||||
|
||||
- [rust.vim](https://github.com/rust-lang/rust.vim)
|
||||
- [vim-crates](https://github.com/mhinz/vim-crates)
|
||||
- [vim-racer](https://github.com/racer-rust/vim-racer)
|
||||
|
||||
#### TeX
|
||||
|
||||
- [vimtex](https://github.com/lervag/vimtex)
|
||||
|
130
README.md
130
README.md
@ -6,7 +6,8 @@
|
||||
<a href='https://github.com/wsdjeg/vim-galore-zh_cn'>Chinese</a> |
|
||||
<a href='http://postd.cc/?s=vim-galore'>Japanese</a> |
|
||||
<a href='https://github.com/lsrdg/vim-galore'>Portuguese</a> |
|
||||
<a href='http://givi.olnd.ru/vim-galore/vim-galore-ru.html'>Russian</a>
|
||||
<a href='http://givi.olnd.ru/vim-galore/vim-galore-ru.html'>Russian</a> |
|
||||
<a href='https://github.com/kyoz/vim-galore-vi'>Vietnamese</a>
|
||||
<div>
|
||||
<br />
|
||||
<sub>Licensed under <a href='https://creativecommons.org/licenses/by-sa/4.0'>CC BY-SA 4.0<a/>.</sub>
|
||||
@ -74,6 +75,7 @@
|
||||
|
||||
### [Tips](#tips-1)
|
||||
|
||||
- [Go to other end of selected text](#go-to-other-end-of-selected-text)
|
||||
- [Saner behavior of n and N](#saner-behavior-of-n-and-n)
|
||||
- [Saner command-line history](#saner-command-line-history)
|
||||
- [Saner CTRL-L](#saner-ctrl-l)
|
||||
@ -111,6 +113,7 @@
|
||||
- [Vim distributions](#vim-distributions)
|
||||
- [Standard plugins](#standard-plugins)
|
||||
- [Map CapsLock to Control](#map-capslock-to-control)
|
||||
- [Generating HTML from buffer](#generating-html-from-buffer)
|
||||
- [Easter eggs](#easter-eggs)
|
||||
- [Why hjkl for navigation?](#why-hjkl-for-navigation)
|
||||
|
||||
@ -126,6 +129,10 @@
|
||||
|
||||
- [Newline used for NUL](#newline-used-for-nul)
|
||||
|
||||
### [Terminology](#terminology-1)
|
||||
|
||||
- [Vim script? Vimscript? VimL?](#vim-script-vimscript-viml)
|
||||
|
||||
### [List of colorschemes](PLUGINS.md#colorschemes-1)
|
||||
|
||||
### [List of plugins](PLUGINS.md)
|
||||
@ -291,7 +298,6 @@ Help:
|
||||
|
||||
- http://people.csail.mit.edu/vgod/vim/vim-cheat-sheet-en.png
|
||||
- https://cdn.shopify.com/s/files/1/0165/4168/files/preview.png
|
||||
- http://www.nathael.org/Data/vi-vim-cheat-sheet.svg
|
||||
- http://michael.peopleofhonoronly.com/vim/vim_cheat_sheet_for_programmers_screen.png
|
||||
- http://www.rosipov.com/images/posts/vim-movement-commands-cheatsheet.png
|
||||
|
||||
@ -740,17 +746,17 @@ See `:h text-objects` for all available text objects.
|
||||
|
||||
## Autocmds
|
||||
|
||||
On many occasions, Vim emits events. You hook into these events by using
|
||||
autocmds.
|
||||
You can trigger an action after many events in Vim, such as a buffer being
|
||||
saved or Vim having started up, by so-called _autocmds_.
|
||||
|
||||
You wouldn't use Vim if there weren't autocmds. They're used all the time, even
|
||||
if you don't notice it. Don't believe me? Check `:au`, but don't let the output
|
||||
overwhelm you. These are all the autocmds that are in effect right now!
|
||||
Vim relies extensively on autocmds. Don't believe me? Check `:au`, but don't let
|
||||
the output overwhelm you. These are all the autocmds that are in effect right
|
||||
now!
|
||||
|
||||
See `:h {event}` for a quick overview of all available events and `:h
|
||||
autocmd-events-abc` for more details.
|
||||
|
||||
A typical example would be setting filetype-specific settings:
|
||||
A typical example would be filetype-specific settings:
|
||||
|
||||
```vim
|
||||
autocmd FileType ruby setlocal shiftwidth=2 softtabstop=2 comments-=:#
|
||||
@ -776,7 +782,7 @@ au BufNewFile,BufRead *.rb,*.rbw setf ruby
|
||||
```
|
||||
|
||||
The `BufNewFile` and `BufRead` events in this case are hardcoded in the C
|
||||
sources of Vim and get emitted everytime you open a file via `:e` and similar
|
||||
sources of Vim and get emitted every time you open a file via `:e` and similar
|
||||
commands. Afterwards all the hundreds of filetypes from `filetype.vim` are
|
||||
tested for.
|
||||
|
||||
@ -1976,6 +1982,17 @@ https://gist.github.com/XVilka/8346728
|
||||
|
||||
# Tips
|
||||
|
||||
## Go to other end of selected text
|
||||
|
||||
`o` and `O` in a visual selection make the cursor go to the other end. Try with
|
||||
blockwise selection to see the difference. This is useful for quickly changing
|
||||
the size of the selected text.
|
||||
|
||||
```
|
||||
:h v_o
|
||||
:h v_O
|
||||
```
|
||||
|
||||
## Saner behavior of n and N
|
||||
|
||||
The direction of `n` and `N` depends on whether `/` or `?` was used for
|
||||
@ -1985,7 +2002,12 @@ If you want `n` to always search forward and `N` backward, use this:
|
||||
|
||||
```vim
|
||||
nnoremap <expr> n 'Nn'[v:searchforward]
|
||||
xnoremap <expr> n 'Nn'[v:searchforward]
|
||||
onoremap <expr> n 'Nn'[v:searchforward]
|
||||
|
||||
nnoremap <expr> N 'nN'[v:searchforward]
|
||||
xnoremap <expr> N 'nN'[v:searchforward]
|
||||
onoremap <expr> N 'nN'[v:searchforward]
|
||||
```
|
||||
|
||||
## Saner command-line history
|
||||
@ -1998,13 +2020,16 @@ So far, so good. But `<up>` and `<down>` are even smarter! They recall the
|
||||
command-line whose beginning matches the current command-line. E.g. `:echo <up>`
|
||||
may change to `:echo "Vim rocks!"`.
|
||||
|
||||
Of course, I don't want you to reach to the arrow keys, just map it instead:
|
||||
Of course, I don't want you to reach for the arrow keys:
|
||||
|
||||
```vim
|
||||
cnoremap <c-n> <down>
|
||||
cnoremap <c-p> <up>
|
||||
cnoremap <expr> <c-n> wildmenumode() ? "\<c-n>" : "\<down>"
|
||||
cnoremap <expr> <c-p> wildmenumode() ? "\<c-p>" : "\<up>"
|
||||
```
|
||||
|
||||
Here we also distinguish between command-line history and the wildmenu. See `:h
|
||||
'wildmenu'`.
|
||||
|
||||
I depend on this behaviour several times a day.
|
||||
|
||||
## Saner CTRL-L
|
||||
@ -2177,8 +2202,8 @@ Always use a dark gray statusline, no matter what colorscheme is chosen:
|
||||
autocmd ColorScheme * highlight StatusLine ctermbg=darkgray cterm=NONE guibg=darkgray gui=NONE
|
||||
```
|
||||
|
||||
This triggers every time you use `:colorscheme ...`. If you want it to trigger only for
|
||||
a certain colorscheme:
|
||||
This triggers every time you use `:colorscheme ...`. If you want it to trigger
|
||||
only for a certain colorscheme:
|
||||
|
||||
```vim
|
||||
autocmd ColorScheme desert highlight StatusLine ctermbg=darkgray cterm=NONE guibg=darkgray gui=NONE
|
||||
@ -2371,13 +2396,11 @@ profile.
|
||||
|
||||
If you want to profile _everything_, do this:
|
||||
|
||||
```
|
||||
:profile start /tmp/profile.log
|
||||
:profile file *
|
||||
:profile func *
|
||||
<do something in Vim>
|
||||
<quit Vim>
|
||||
```
|
||||
:profile start /tmp/profile.log
|
||||
:profile file *
|
||||
:profile func *
|
||||
<do something in Vim>
|
||||
:qa
|
||||
|
||||
Vim keeps the profiling information in memory and only writes it out to the
|
||||
logfile on exit. (Neovim has fixed this using `:profile dump`).
|
||||
@ -2385,11 +2408,15 @@ logfile on exit. (Neovim has fixed this using `:profile dump`).
|
||||
Have a look at `/tmp/profile.log`. All code that was executed during profiling
|
||||
will be shown. Every line, how often it was executed and how much time it took.
|
||||
|
||||
Most of the time that will be plugin code the user isn't familiar with, but if
|
||||
you're investigating a certain issue, jump to the bottom of the log. Here are
|
||||
two different sections `FUNCTIONS SORTED ON TOTAL TIME` and `FUNCTIONS SORTED ON
|
||||
SELF TIME` that are worth gold. At a quick glance you can see, if a certain
|
||||
function is taking too long.
|
||||
Jump to the bottom of the log. Here are two different sections `FUNCTIONS SORTED
|
||||
ON TOTAL TIME` and `FUNCTIONS SORTED ON SELF TIME` that are worth gold. At a
|
||||
quick glance you can see which functions are taking the longest.
|
||||
|
||||
You can use `:profile` during startup as well:
|
||||
|
||||
$ vim --cmd 'prof start prof.log | prof file * | prof func *' test.c
|
||||
:q
|
||||
$ tail -50 prof.log
|
||||
|
||||
## Debugging Vim scripts
|
||||
|
||||
@ -2473,12 +2500,16 @@ See `:h :syntime`.
|
||||
| [Seven habits of effective text editing 2.0 (PDF)](http://www.moolenaar.net/habits_2007.pdf) | See above. |
|
||||
| [IBM DeveloperWorks: Scripting the Vim editor](http://www.ibm.com/developerworks/views/linux/libraryview.jsp?sort_order=asc&sort_by=Title&search_by=scripting+the+vim+editor) | Five-part series on Vim scripting. |
|
||||
| [Learn Vimscript the Hard Way](http://learnvimscriptthehardway.stevelosh.com) | Develop a Vim plugin from scratch. |
|
||||
| [Practical Vim (2nd Edition)](http://www.amazon.com/Practical-Vim-Edit-Speed-Thought/dp/1680501275/) | Hands down the best book about Vim. |
|
||||
| [Vimcasts.org](http://vimcasts.org/episodes/archive) | Vim screencasts. |
|
||||
| [wincent's screencasts on YouTube](https://www.youtube.com/channel/UCXPHFM88IlFn68OmLwtPmZA) | Vim screencasts. |
|
||||
| [Practical Vim (2nd Edition)](https://pragprog.com/titles/dnvim2/practical-vim-second-edition) | Hands down the best book about Vim. |
|
||||
| [Why, oh WHY, do those #?@! nutheads use vi?](http://www.viemu.com/a-why-vi-vim.html) | Common misconceptions explained. |
|
||||
| [Your problem with Vim is that you don't grok vi](http://stackoverflow.com/a/1220118) | Concise, informative and correct. A real gem. |
|
||||
|
||||
#### Screencasts
|
||||
|
||||
- [vimcasts.org](http://vimcasts.org/episodes/archive)
|
||||
- [By wincent](https://www.youtube.com/channel/UCXPHFM88IlFn68OmLwtPmZA)
|
||||
- [By Derek Wyatt](http://derekwyatt.org/vim/tutorials/index.html)
|
||||
|
||||
## Vim distributions
|
||||
|
||||
Vim distributions are bundles of custom settings and plugins for Vim.
|
||||
@ -2504,13 +2535,15 @@ looking at a few distributions:
|
||||
|
||||
## Standard plugins
|
||||
|
||||
Surprising to many people, Vim comes with a handful of plugins on its own that
|
||||
all get loaded by default. Check `:scriptnames` after starting Vim to see all
|
||||
sourced files.
|
||||
Many people are surprised by the fact that Vim comes with a handful of standard
|
||||
plugins. Some get loaded by default (`:e $VIMRUNTIME/plugin`) and some are not
|
||||
(`:e $VIMRUNTIME/pack/dist/opt`). Read `:h pack-add` on how to source the
|
||||
latter.
|
||||
|
||||
Most of them will never get used, so disable them as you see fit. They will
|
||||
still be shown as sourced, but only the first lines actually get read before Vim
|
||||
bails out. No further code (mappings, commands, logic) will be processed.
|
||||
Most of the plugins that get loaded by default will never get used, though.
|
||||
Disable them as you see fit. They will still be shown as sourced
|
||||
(`:scriptnames`), but only the first lines actually get read before Vim bails
|
||||
out. No further code (mappings, commands, logic) will be processed.
|
||||
|
||||
| Plugin | Disable it using.. | Help |
|
||||
|------------|-------------------------------------|------|
|
||||
@ -2560,6 +2593,21 @@ An alternative would be using [caps2esc](https://github.com/oblitum/caps2esc) or
|
||||
See [superuser.com: Map Caps-Lock to Control in Windows
|
||||
8.1](http://superuser.com/questions/764782/map-caps-lock-to-control-in-windows-8-1).
|
||||
|
||||
## Generating HTML from buffer
|
||||
|
||||
Generate HTML from any buffer using `:TOhtml` from the 2html [standard
|
||||
plugin](#standard-plugins). The output can be used for printing or easy web
|
||||
publishing.
|
||||
|
||||
The command creates a new buffer of the same name with `.html` appended. The
|
||||
colors are the same as seen in Vim. They depend on the
|
||||
[colorscheme](#colorschemes).
|
||||
|
||||
The plugin knows several options to finetune the output, e.g. for setting the
|
||||
encoding and font.
|
||||
|
||||
See `:h :TOhtml`.
|
||||
|
||||
## Easter eggs
|
||||
|
||||
| Command | Message |
|
||||
@ -2573,6 +2621,7 @@ See [superuser.com: Map Caps-Lock to Control in Windows
|
||||
| `:h map-modes` | `:nunmap can also be used outside of a monastery.` |
|
||||
| `:help!` | `E478: Don't panic!` (Glitch? When used in a help buffer (`buftype=help`) this works like `:h help.txt` instead.) |
|
||||
| `:smile` | Try it out yourself. ;-) Added in 7.4.1005. |
|
||||
| `:hi!` | `Greetings, Vim user!` |
|
||||
|
||||
## Why hjkl for navigation?
|
||||
|
||||
@ -2746,3 +2795,14 @@ displayed in a buffer as `^@`.
|
||||
|
||||
See `man 7 ascii` and `:h NL-used-for-Nul` for more information.
|
||||
|
||||
# Terminology
|
||||
|
||||
## Vim script? Vimscript? VimL?
|
||||
|
||||
`Vim script`, `Vimscript`, and `VimL` all refer to the same thing: The
|
||||
programming language used for scripting Vim. Even though
|
||||
[8.0.360](https://github.com/vim/vim/commit/b544f3c81f1e6a50322855681ac266ffaa8e313c)
|
||||
changed all references from `VimL` to `Vim script`, which can now be considered
|
||||
the official term, `VimL` is still widespread all over the internet.
|
||||
|
||||
No matter which term you use, everyone will understand it.
|
||||
|
@ -51,7 +51,7 @@ if &shell =~# 'fish$'
|
||||
endif
|
||||
|
||||
" Put all temporary files under the same directory.
|
||||
" https://github.com/mhinz/vim-galore#handling-backup-swap-undo-and-viminfo-files
|
||||
" https://github.com/mhinz/vim-galore#temporary-files
|
||||
set backup
|
||||
set backupdir =$HOME/.vim/files/backup/
|
||||
set backupext =-vimbackup
|
||||
|
Loading…
x
Reference in New Issue
Block a user