Browse Source

Initial commit.

tags/vimscript-final
Taylor Bockman 2 years ago
commit
6cace31a65
  1. 26
      .gitignore
  2. 70
      README.md
  3. 2812
      autoload/plug.vim
  4. 15
      conf/config.vim
  5. 7
      conf/git.vim
  6. 28
      conf/keybinds.vim
  7. 49
      conf/plugins.vim
  8. 15
      conf/search.vim
  9. 17
      conf/ui.vim
  10. 93
      font/LICENSE.txt
  11. BIN
      font/Sauce Code Pro Semibold Nerd Font Complete.ttf
  12. 17
      init.vim
  13. 5
      ui.vim

26
.gitignore vendored

@ -0,0 +1,26 @@
# Autoload, except for `plug.vim`.
autoload/*
!autoload/plug.vim
# Swap
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# Session
Session.vim
Sessionx.vim
# Temporary
.netrwhist
*~
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~
# plugin downloads
plugged/*

70
README.md

@ -0,0 +1,70 @@
# Vim Configuration
This is V2 of my vim configuration, designed for Neovim, broken out into
it's own repository for easier cloning without pulling down the entire
`essentials` repository.
I use the `nord` theme for both my terminal and Vim. You will need to adjust your theme and
airline according to your tastes in `plugins.vim` and `ui.vim`.
The V2 repo aims to take full advantage of asynchronous code and a modularized configuration to make
adaptation easier and the UI snappier. Additionally support for `tmux` has improved with this iteration
through the use of `vimux`.
## Requirements
1. [Neovim](https://github.com/neovim/neovim)
2. [vim-plug](https://github.com/junegunn/vim-plug) - You may need to install this even with the `autoload` directory.
3. [Monospaced Nerd Font](https://www.nerdfonts.com/font-downloads) - The `/font` directory has one I use.
4. `node` - Certain plugins require node to work. Install it with your package manager.
5. `tmux`
## Structure
* `conf`: Contains all configuration related files.
* `plugins.vim`: Plugin definitions.
* `keybinds.vim`: General keybinds such as leader key, etc.
* `config.vim`: Dumping ground for general configurations.
* `ui.vim`: General UI configurations.
* `search.vim`: Search configurations (for example ctrl-p).
* `git.vim`: Fugitive configurations.
* `langs`: Language specific configurations and keybinds.
## Installation
```bash
cd .config
git clone git@git.xchg.sh:angrygoats/vim-config nvim
```
If you have added/changed plugins remember to `:PlugInstall` after saving. There currently
is no autodetect on a changed `plugin.vim`.
## Language Support
Support for `C`, `C++`, `Python`, `Haskell`, and `OCaml` is installed. To add your own configurations you can
create a file in the same form as those found in `conf/langs/` and place it in the `conf/langs/` folder.
It will be autoloaded.
The current loading script for languages does not check order before loading (so files can be loaded in
any order based on directory structure). However, if you followed the structure and put all your configs
in the correct files, those will be loaded *BEFORE* the languages and so you shouldn't run into (too many)
order issues. This may be patched in the future.
## Other Notes
### Git
`vim-fugitive` is installed. Bindings can be found in `conf/keybinds.vim` and documentation can be found
[here](https://github.com/tpope/vim-fugitive).
### LSP
`vim-lsp` is installed with `vim-lsp-settings`. While editing a file that has a supported LSP server
you can type `LspInstallServer` to install the associated server. You can uninstall a server with
`:LspUninstallServer server-name`. You many need to restart your vim instance once the server is installed
to activate the LSP support.
### Org Mode
`vim-orgmode` is installed. The usage documentation can be found [here](https://github.com/jceb/vim-orgmode/blob/master/doc/orgguide.txt).

2812
autoload/plug.vim

File diff suppressed because it is too large Load Diff

15
conf/config.vim

@ -0,0 +1,15 @@
" General Configurations (Any language/Tool)
" Stripping trailing whitespace on save
autocmd BufWritePre * :%s/\s\+$//e
" Standard variables
set expandtab " tabs to spaces
set tabstop=2 " spaces entered when tab key is pressed
set shiftwidth=2 " spaces entered for indentation
set number " Line numbering
set clipboard+=unnamedplus " Share system clipboard
set eol " End of line at bottom of file
set shiftround
set list
set list listchars=tab:»·,trail

7
conf/git.vim

@ -0,0 +1,7 @@
" Fugitive Configuration
" Fugitive bindings
nnoremap <Leader>gs :Gstatus<CR>
nnoremap <Leader>gd :Gdiff<CR>
nnoremap <Leader>gb :Gblame<CR>
nnoremap <Leader>gc :Gcommit<CR>

28
conf/keybinds.vim

@ -0,0 +1,28 @@
" General-Purpose keybinds
" Space is the leader key when outside of insert mode.
let mapleader=" "
map <silent> <Leader>t :NERDTreeToggle<CR>
nnoremap <silent> <Leader>r :call NumberToggle()<CR>
" Pressing enter in command mode clears the current search highlighting until
" the next search.
nnoremap <silent> <CR> :noh<CR><CR>
" This one maps F5 to delete all trailing whitespace
nnoremap <silent> <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR>
" Togglable relative line numbering
function! NumberToggle()
if(&relativenumber == 1)
set norelativenumber
set number
else
set relativenumber
endif
endfunc
" <SPC>r will toggle relative line numbers.
nnoremap <silent> <Leader>r :call NumberToggle()<CR>

49
conf/plugins.vim

@ -0,0 +1,49 @@
" Plugin definitions.
" I have no idea how to auto-install vim-plug on Windows
" so you will have to install it manually.
if !(has('win16') || has('win32') || has('win64'))
if empty(glob('~/.config/nvim/autoload/plug.vim'))
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall | source %
endif
endif
call plug#begin('~/.config/nvim/plugged')
" UI
Plug 'arcticicestudio/nord-vim'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'ryanoasis/vim-devicons'
Plug 'preservim/nerdtree'
" General Editing
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
"" Search
Plug 'kien/ctrlp.vim'
"" Git
Plug 'tpope/vim-fugitive'
"" LSP
Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
"" Autocomplete
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'prabirshrestha/asyncomplete-lsp.vim'
"" Tmux Helper
Plug 'preservim/vimux'
"" Linting
Plug 'w0rp/ale'
"" Planning
Plug 'jceb/vim-orgmode'
call plug#end()

15
conf/search.vim

@ -0,0 +1,15 @@
" Specific search configurations
" ctrlp hotkeys
let g:ctrlp_map='<c-p>'
let g:ctrlp_cmd='CtrlP'
" Rebind Ctrl-P to match the window opening keys of nerd tree
let g:ctrl_p_prompt_mappings = {
\ 'AcceptSelection("h")': ['<c-i>', '<c-cr>', '<c-s>'],
\ 'AcceptSelection("v")': ['<c-s>', '<RightMouse>'],
\ }
" ctrlp configuration
set wildignore+=*/tmp/*,*.so,*.swp,*.zip " MacOSX/Linux
set wildignore+=*\\tmp\\*,*.swp,*.zip,*.exe " Windows

17
conf/ui.vim

@ -0,0 +1,17 @@
" UI Definitions
colorscheme nord
" Helps some themes.
if (has('nvim'))
let $NVIM_TUI_ENABLE_TRUE_COLOR = 1
endif
if (has('termguicolors'))
set termguicolors
endif
" Always show hidden files in nerdtree
let NERDTreeShowHidden=1

93
font/LICENSE.txt

@ -0,0 +1,93 @@
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

BIN
font/Sauce Code Pro Semibold Nerd Font Complete.ttf

Binary file not shown.

17
init.vim

@ -0,0 +1,17 @@
" Initialization
let g:nvim_config_root = stdpath('config')
exe 'source' g:nvim_config_root . '/conf/plugins.vim'
exe 'source' g:nvim_config_root . '/conf/keybinds.vim'
exe 'source' g:nvim_config_root . '/conf/config.vim'
exe 'source' g:nvim_config_root . '/conf/ui.vim'
exe 'source' g:nvim_config_root . '/conf/search.vim'
exe 'source' g:nvim_config_root . '/conf/git.vim'
let lang_configs = glob(g:nvim_config_root . '/conf/langs/*.vim')
for lang_config in lang_configs
exe 'source' lang_config
endfor

5
ui.vim

@ -0,0 +1,5 @@
" UI Definitions
colorscheme nord
Loading…
Cancel
Save