Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vim-Plugin.yml #1

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open

Vim-Plugin.yml #1

wants to merge 18 commits into from

Conversation

eph-raim
Copy link

@eph-raim eph-raim commented Apr 8, 2022

#@vphantom &
#@vim-plugin.yml

  • use vim with no plugin

  • nocompatible: Stops odd issues †.

  • number: Turn on line numbers.

  • cursorline: Highlight the current line.

  • expandtab: Convert tabs to spaces.

  • hlsearch: Highlight all search matches.

  • visualbell: Stop Vim from beeping at you when you make a mistake.

  • tabstop: Set tab size in spaces (this is for manual indenting).

  • shiftwidth: The number of spaces inserted for a tab (used for auto indenting).

  • syntax on: Enable basic syntax highlighting.

#NOTE: If you do decide to use plugins, then don’t forget to vim -c ":helptags ALL" -c ":q" to ensure you get all the relevant help information loaded.

  • Now, there may be times where you want a minimal config but with some extra treats, I’ll typically have a ~/.vimrc-core file with the following configuration that gives me the above ‘basic’ configuration (with some other configuration which isn’t essential but also isn’t superfluous either) along with some core plugins I like to use):

  • set nocompatible number autoread cursorline expandtab hlsearch visualbell tabstop=2 shiftwidth=2 clipboard+=unnamed wildmenu hidden noswapfile
    syntax on
    packadd cfilter

  • call plug#begin('~/.vim/plugged')
    -Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
    -Plug 'junegunn/fzf.vim' " to select multiple results
    -Plug 'mileszs/ack.vim'
    -Plug 'unblevable/quick-scope'
    -call plug#end()

  • map f :FZF
    -map b :Buffers!
    -map g :GFiles?
    -map w :Windows
    -map l :Lines
    -map t :AgC

  • set wildignore+=/.git/,/node_modules/,/.hg/,/.svn/.,*/.DS_Store
    set wildmode=list:longest,list:full

autocmd VimEnter * command! -nargs=* -bang AgC call fzf#vim#ag(, '--path-to-ignore ~/.ignore --hidden --ignore "node_modules" --ignore-dir="vendor" --skip-vcs-ignores', 0)

#let g:ackprg = 'ag --vimgrep --smart-case --path-to-ignore ~/.ignore --hidden --ignore-dir=node_modules --ignore-dir=vendor --skip-vcs-ignores'

#let g:ack_mappings = {
\ "h": ":exe 'wincmd ' (&splitbelow ? 'J' : 'K')pJp",
\ "v": ":exe 'wincmd ' (&splitright ? 'L' : 'H')pJp"}

silent! tnoremap <C->

rsrchboy and others added 15 commits October 3, 2017 11:46
This call will allow people to hook in after a session has been saved --
e.g. for updating a `Sessionx.vim`.

(This code cribbed from `fugitive.vim`)
The status is never read from the hard-coded this_obsession_status, but
computed in ObsessionStatus() from this_obsession.
Unless someone dives into the source code, there is no way of knowing
the option to disable saving session on BufEnter exists.
This targets unnamed buftype=nofile buffers, which includes some false
positives, but such false positives aren't particularly useful to store
in a session file anyways.

Closes #59
This complements the `Obsession` autocmd, allowing users to add hooks
which might affect what obsession stores, for example, populating
`g:obsession_append` to restore tab- or window-local variables.
Copy link
Author

@eph-raim eph-raim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1
Installation
Via Plugin Manager (Recommended)
Vim Plug
Vundle
NeoBundle
Pathogen
Vim 8+ Packages
Manual Installation
Unix
Windows
Post Installation
Make sure that you have filetype plugins enabled, as the plugin makes use of |commentstring| where possible (which is usually set in a filetype plugin). See |filetype-plugin-on| for details, but the short version is make sure this line appears in your vimrc:

filetype plugin on
Usage
Documentation
Please see the vim help system for full documentation of all options: :help nerdcommenter

Settings
Several settings can be added to your vimrc to change the default behavior. Some examples:

" Create default mappings
let g:NERDCreateDefaultMappings = 1

" Add spaces after comment delimiters by default
let g:NERDSpaceDelims = 1

" Use compact syntax for prettified multi-line comments
let g:NERDCompactSexyComs = 1

" Align line-wise comment delimiters flush left instead of following code indentation
let g:NERDDefaultAlign = 'left'

" Set a language to use its alternate delimiters by default
let g:NERDAltDelims_java = 1

" Add your own custom formats or override the defaults
let g:NERDCustomDelimiters = { 'c': { 'left': '/**','right': '*/' } }

" Allow commenting and inverting empty lines (useful when commenting a region)
let g:NERDCommentEmptyLines = 1

" Enable trimming of trailing whitespace when uncommenting
let g:NERDTrimTrailingWhitespace = 1

" Enable NERDCommenterToggle to check all selected lines is commented or not
let g:NERDToggleCheckAllLines = 1
Default mappings
Note: You can turn off settings default mappings to provide your own from scratch (look at the Settings list above)

The following key mappings are provided by default (there is also a menu provided that contains menu items corresponding to all the below mappings):

Most of the following mappings are for normal/visual mode only. The |NERDCommenterInsert| mapping is for insert mode only.

[count]cc |NERDCommenterComment|

Comment out the current line or text selected in visual mode.

[count]cn |NERDCommenterNested|

Same as cc but forces nesting.

[count]c |NERDCommenterToggle|

Toggles the comment state of the selected line(s). If the topmost selected line is commented, all selected lines are uncommented and vice versa.

[count]cm |NERDCommenterMinimal|

Comments the given lines using only one set of multipart delimiters.

[count]ci |NERDCommenterInvert|

Toggles the comment state of the selected line(s) individually.

[count]cs |NERDCommenterSexy|

Comments out the selected lines with a pretty block formatted layout.

[count]cy |NERDCommenterYank|

Same as cc except that the commented line(s) are yanked first.

c$ |NERDCommenterToEOL|

Comments the current line from the cursor to the end of line.

cA |NERDCommenterAppend|

Adds comment delimiters to the end of line and goes into insert mode between them.

|NERDCommenterInsert|

Adds comment delimiters at the current cursor position and inserts between. Disabled by default.

ca |NERDCommenterAltDelims|

Switches to the alternative set of delimiters.

[count]cl |NERDCommenterAlignLeft [count]cb |NERDCommenterAlignBoth

Same as |NERDCommenterComment| except that the delimiters are aligned down the left side (cl) or both sides (cb).

[count]cu |NERDCommenterUncomment|

Uncomments the selected line(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants