Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vim-config
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mtrame
vim-config
Commits
10aec3cd
Commit
10aec3cd
authored
4 years ago
by
mtrame
Browse files
Options
Downloads
Patches
Plain Diff
prepping for some scripting for mitch's config..
parent
e5e765ce
Branches
master
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.vimrc
+30
-56
30 additions, 56 deletions
.vimrc
with
30 additions
and
56 deletions
.vimrc
+
30
−
56
View file @
10aec3cd
"------------------------------------------------------------
" Features {{{1
"
" These options and commands enable some very useful features in Vim, that
" no user should have to live without.
" https://www.linux.com/training-tutorials/using-spell-checking-vim/
" setlocal spell spelllang=en_us
" Set 'nocompatible' to ward off unexpected things that your distro might
" have made, as well as sanely reset options when re-sourcing .vimrc
...
...
@@ -17,30 +14,8 @@ filetype indent plugin on
syntax
on
set
noswapfile
"------------------------------------------------------------
" Must have options {{{1
"
" These are highly recommended options.
" Vim with default settings does not allow easy switching between multiple files
" in the same editor window. Users can use multiple split windows or multiple
" tab pages to edit multiple files, but it is still best to enable an option to
" allow easier switching between files.
"
" One such option is the 'hidden' option, which allows you to re-use the same
" window and switch from an unsaved buffer without saving it first. Also allows
" you to keep an undo history for multiple files when re-using the same window
" in this way. Note that using persistent undo also lets you undo in multiple
" files even in the same window, but is less efficient and is actually designed
" for keeping undo history after closing Vim entirely. Vim will complain if you
" try to quit without saving, and swap files will keep you safe if your computer
" crashes.
set
hidden
" Note that not everyone likes working this way (with the hidden option).
" Alternatives include using tabs or split windows instead of re-using the same
" window as mentioned above, and/or either of the following options:
" set confirm
" set autowriteall
" Better command-line completion
set
wildmenu
...
...
@@ -52,20 +27,9 @@ set showcmd
" mapping of <C-L> below)
set
hlsearch
" Modelines have historically been a source of security vulnerabilities. As
" such, it may be a good idea to disable them and use the securemodelines
" script, <http://www.vim.org/scripts/script.php?script_id=1876>.
" set nomodeline
" set cc=80
"------------------------------------------------------------
" Usability options {{{1
"
" These are options that users frequently set in their .vimrc. Some of them
" change Vim's behaviour in ways which deviate from the true Vi way, but
" which are considered to add usability. Which, if any, of these options to
" use is very much a personal preference, but they are harmless.
highlight
ColorColumn ctermbg
=
magenta
call
matchadd
(
'ColorColumn'
,
'\%81v'
,
100
)
" Use case insensitive search, except when using capital letters
set
ignorecase
...
...
@@ -74,9 +38,7 @@ set smartcase
" Allow backspacing over autoindent, line breaks and start of insert action
set
backspace
=
indent
,
eol
,
start
" When opening a new line and no filetype-specific indenting is enabled, keep
" the same indent as the line you're currently on. Useful for READMEs, etc.
set
autoindent
set
smartindent
" Stop certain movements from always going to the first character of a line.
" While this behaviour deviates from that of Vi, it does what most users
...
...
@@ -110,7 +72,7 @@ set mouse=a
set
cmdheight
=
2
" Display line numbers on the left
set
nu
mber
set
nu
set
relativenumber
" Quickly time out on keycodes, but never time out on mappings
...
...
@@ -119,6 +81,7 @@ set notimeout ttimeout ttimeoutlen=200
" Use <F11> to toggle between 'paste' and 'nopaste'
set
pastetoggle
=<
F11
>
set
incsearch
"------------------------------------------------------------
" Indentation options {{{1
...
...
@@ -128,19 +91,15 @@ set pastetoggle=<F11>
" Indentation settings for using 4 spaces instead of tabs.
" Do not change 'tabstop' from its default value of 8 with this setup.
set
shiftwidth
=
4
set
tabstop
=
4
set
softtabstop
=
4
set
expandtab
" Indentation settings for using hard tabs for indent. Display tabs as
" four characters wide.
"set shiftwidth=4
"set tabstop=4
"------------------------------------------------------------
" Mappings {{{1
"
" Useful mappings
let
mapleader
=
" "
" Map Y to act like D and C, i.e. to yank until EOL, rather than act as yy,
" which is the default
...
...
@@ -150,11 +109,17 @@ map Y y$
" next search
nnoremap
<
C
-
L
>
:
nohl
<
CR
><
C
-
L
>
imap
<
Tab
>
<
C
-
p
>
" Thanks Primeagen!! {{{
nnoremap
<
silent
>
<
Leader
>
gd
:
YcmCompleter GoTo
<
CR
>
nnoremap
<
silent
>
<
Leader
>
gf
:
YcmCompleter FixIt
<
CR
>
" Move selection up or down
vnoremap J
:
m
'
>+
1
<
CR
>
gv
=
gv
vnoremap K
:
m
'
<
-2
<
CR
>
gv
=
gv
" }}}
vnoremap
<
Tab
>
<
C
-
p
>
" pathogen.vim
" see github for install on other machines
" execute pathogen#infect()
"------------------------------------------------------------
" Specify a directory for plugins
...
...
@@ -162,8 +127,16 @@ imap <Tab> <C-p>
" - Avoid using standard Vim directory names like 'plugin'
call
plug#begin
(
'~/.vim/plugged'
)
" Make sure you use single quotes
Plug
'jiangmiao/auto-pairs'
Plug
'mbbill/undotree'
" Plug 'Valloric/YouCompleteMe', { 'do': './install.py' }
Plug
'neoclide/coc.nvim'
,
{
'branch'
:
'release'
}
Plug
'junegunn/fzf'
" Make sure you use single quotes
Plug
'junegunn/goyo.vim'
" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
...
...
@@ -187,7 +160,7 @@ Plug 'vim-airline/vim-airline'
Plug
'pangloss/vim-javascript'
Plug
'
vim-latex
/vim
-la
tex'
Plug
'
lervag
/vimtex'
Plug
'xolox/vim-misc'
...
...
@@ -197,6 +170,7 @@ Plug 'vimwiki/vimwiki'
call
plug#end
()
" Initialize plugin system
" Start up NERDTree when no file is specified
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment