remove vim/ and add symlinks
Remove the vim configuration files from the repository. I have moved fully over to neovim and so these configuration files have stagnated. Instead, let's symlink the neovim config for vim * remove vim/ * add symlinking code in install/link.sh to symlink neovim config for vim * symlink config/nvim -> ~/.vim * symlink config/nvim/init.vim -> ~/.vimrc * Remove old/outdated info from README * Revise Vim and Neovim section of README
This commit is contained in:
47
README.md
47
README.md
@@ -73,44 +73,29 @@ The prompt will also display a ✱ character in the `RPROMPT` indicating that th
|
||||
|
||||
## Vim and Neovim Setup
|
||||
|
||||
vim and neovim should just work once the correct plugins are installed. To install the plugins, you will need to open vim/neovim in the following way:
|
||||
[Neovim](https://neovim.io/) is a fork and drop-in replacement for vim. in most cases, you would not notice a difference between the two, other than Neovim allows plugins to run asynchronously so that they do not freeze the editor, which is the main reason I have switched over to it. Vim and Neovim both use Vimscript and most plugins will work in both (all of the plugins I use do work in both Vim and Neovim). For this reason, they share the same configuration files in this setup. Neovim uses the [XDG base directory specification](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) which means it won't look for a `.vimrc` in your home directory. Instead, its configuration looks like the following:
|
||||
|
||||
for vim
|
||||
```bash
|
||||
vim +PlugInstall
|
||||
```
|
||||
| | Vim | Neovim |
|
||||
|-------------------------|------------|---------------------------|
|
||||
| Main Configuratin File | `~/.vimrc` | `~/.config/nvim/init.vim` |
|
||||
| Configuration directory | `~/.vim` | `~/.config/nvim` |
|
||||
|
||||
### Installation
|
||||
|
||||
Vim is likely already installed on your system. If using a Mac, MacVim will be installed from Homebrew. Neovim will also be installed from Homebrew by default on a Mac. For other systems, you may need to install Neovim manually. See their [web site](https://neovim.io) for more information.
|
||||
|
||||
[`link.sh`](install/link.sh) will symlink the XDG configuration directory into your home directory and will then create symlinks for `.vimrc` and `.vim` over to the Neovim configuration so that Vim and Neovim will both be configured in the same way from the same files. The benefit of this configuration is that you only have to maintain a single vim configuration for both, so that if Neovim (which is still alpha software) has issues, you can very seamlessly transition back to vim with no big impact to your productivity.
|
||||
|
||||
Inside of [`.zshrc`](zsh/zshrc.symlink), the `EDITOR` shell variable is set to `nvim`, defaulting to Neovim for editor tasks, such as git commit messages. Additionally, I have aliased `vim` to `nvim` in [`aliases.zsh`](zsh/aliases.zsh) You can remove this if you would rather not alias the `vim` command to `nvim`.
|
||||
|
||||
vim and neovim should just work once the correct plugins are installed. To install the plugins, you will need to open Neovim in the following way:
|
||||
|
||||
for neovim
|
||||
```bash
|
||||
nvim +PlugInstall
|
||||
```
|
||||
|
||||
### Fonts
|
||||
## Fonts
|
||||
|
||||
I am currently using [Hack](http://sourcefoundry.org/hack/) as my default font, which does include Powerline support, so you don't need an additional patched font. In addition to this, I do have [nerd-fonts](https://github.com/ryanoasis/nerd-fonts) installed and configured to be used for non-ascii characters. If you would prefer not to do this, then simply remove the `Plug 'ryanoasis/vim-devicons'` plugin from vim/nvim. Then, I configure the fonts in this way in iTerm2:
|
||||
|
||||

|
||||
|
||||
-----
|
||||
|
||||
+ zsh configuration
|
||||
+ vim configuration
|
||||
+ tmux configuration
|
||||
+ git configuration
|
||||
+ osx configuration
|
||||
+ Node.js setup (nvm)
|
||||
+ Homebrew
|
||||
|
||||
## Install
|
||||
|
||||
1. `git clone https://github.com/nicknisi/dotfiles.git ~/.dotfiles`
|
||||
1. `cd ~/.dotfiles`
|
||||
1. `./install.sh`
|
||||
|
||||
## ZSH Plugins
|
||||
|
||||
By default, the `.zshrc` file will source any file within `.dotfiles/zsh` that have the `.zsh` extension.
|
||||
|
||||
## Vim Plugins
|
||||
|
||||
Vim plugins are managed with [vim-plug](https://github.com/junegunn/vim-plug). To install, run `vim +PlugInstall`.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
DOTFILES=$HOME/.dotfiles
|
||||
|
||||
@@ -31,3 +31,25 @@ for config in $DOTFILES/config/*; do
|
||||
ln -s $config $target
|
||||
fi
|
||||
done
|
||||
|
||||
# create vim symlinks
|
||||
# As I have moved off of vim as my full time editor in favor of neovim,
|
||||
# I feel it doesn't make sense to leave my vimrc intact in the dotfiles repo
|
||||
# as it is not really being actively maintained. However, I would still
|
||||
# like to configure vim, so lets symlink ~/.vimrc and ~/.vim over to their
|
||||
# neovim equivalent.
|
||||
|
||||
echo "\nCreating vim symlinks"
|
||||
echo "=============================="
|
||||
|
||||
typeset -A vimfiles=(~/.vim $DOTFILES/config/nvim ~/.vimrc $DOTFILES/config/nvim/init.vim)
|
||||
|
||||
for file in "${(@k)vimfiles}"; do
|
||||
# echo "$file -> $vimfiles[$file]"
|
||||
if [ -e ${file} ]; then
|
||||
echo "${file} already exists... skipping"
|
||||
else
|
||||
echo "Creating symlink for $file"
|
||||
ln -s $vimfiles[$file] $file
|
||||
fi
|
||||
done
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,73 +0,0 @@
|
||||
filetype off
|
||||
|
||||
" set rtp+=~/.vim/bundle/vundle/
|
||||
call plug#begin('~/.vim/plugged')
|
||||
|
||||
" let vundle manage vundle
|
||||
" Plugin 'gmarik/vundle'
|
||||
"
|
||||
" colorschemes
|
||||
Plug 'chriskempson/base16-vim'
|
||||
|
||||
|
||||
Plug 'kien/ctrlp.vim'
|
||||
Plug 'scrooloose/nerdtree', { 'on': ['NERDTreeToggle', 'NERDTreeFind'] } | Plug 'Xuyuanp/nerdtree-git-plugin' | Plug 'ryanoasis/vim-devicons'
|
||||
Plug 'mileszs/ack.vim'
|
||||
Plug 'Raimondi/delimitMate'
|
||||
Plug 'tpope/vim-commentary'
|
||||
Plug 'tpope/vim-unimpaired'
|
||||
Plug 'tpope/vim-endwise'
|
||||
Plug 'tpope/vim-ragtag'
|
||||
Plug 'tpope/vim-surround'
|
||||
Plug 'benmills/vimux'
|
||||
Plug 'bling/vim-airline'
|
||||
Plug 'scrooloose/syntastic'
|
||||
" Plug 'benekastah/neomake'
|
||||
Plug 'tpope/vim-fugitive'
|
||||
Plug 'tpope/vim-repeat'
|
||||
Plug 'garbas/vim-snipmate'
|
||||
Plug 'editorconfig/editorconfig-vim'
|
||||
Plug 'MarcWeber/vim-addon-mw-utils'
|
||||
Plug 'tomtom/tlib_vim'
|
||||
Plug 'sotte/presenting.vim'
|
||||
Plug 'ervandew/supertab'
|
||||
Plug 'tpope/vim-dispatch'
|
||||
" Plug 'mtth/scratch.vim'
|
||||
Plug 'tpope/vim-vinegar'
|
||||
" Plug 'tpope/vim-abolish'
|
||||
Plug 'AndrewRadev/splitjoin.vim'
|
||||
Plug 'vim-scripts/matchit.zip'
|
||||
Plug 'tpope/vim-sleuth' " detect indent style (tabs vs. spaces)
|
||||
Plug 'sickill/vim-pasta' " context-aware pasting
|
||||
Plug 'junegunn/goyo.vim', { 'on': 'Goyo' } " distraction-free writing
|
||||
Plug 'junegunn/limelight.vim', { 'on': 'Limelight' } " focus tool. Good for presentating with vim
|
||||
|
||||
" language-specific plugins
|
||||
Plug 'mattn/emmet-vim', { 'for': 'html' }
|
||||
Plug 'gregsexton/MatchTag', { 'for': 'html' }
|
||||
Plug 'othree/html5.vim', { 'for': 'html' }
|
||||
Plug 'pangloss/vim-javascript', { 'for': 'javascript' }
|
||||
Plug 'moll/vim-node', { 'for': 'javascript' }
|
||||
Plug 'jelera/vim-javascript-syntax', { 'for': 'javascript' }
|
||||
Plug 'mxw/vim-jsx', { 'for': 'jsx' }
|
||||
Plug 'elzr/vim-json', { 'for': 'json' }
|
||||
Plug 'Quramy/tsuquyomi', { 'for': 'typescript', 'do': 'npm install' }
|
||||
Plug 'Shougo/vimproc.vim', { 'do': 'make' }
|
||||
Plug 'leafgarland/typescript-vim', { 'for': 'typescript' }
|
||||
" Plug 'juvenn/mustache.vim', { 'for': 'mustache' }
|
||||
Plug 'mustache/vim-mustache-handlebars'
|
||||
Plug 'digitaltoad/vim-jade', { 'for': 'jade' }
|
||||
Plug 'cakebaker/scss-syntax.vim', { 'for': 'scss' }
|
||||
Plug 'wavded/vim-stylus', { 'for': ['stylus', 'markdown'] }
|
||||
Plug 'groenewege/vim-less', { 'for': 'less' }
|
||||
Plug 'ap/vim-css-color', { 'for': 'css' }
|
||||
Plug 'hail2u/vim-css3-syntax', { 'for': 'css' }
|
||||
Plug 'itspriddle/vim-marked', { 'for': 'markdown', 'on': 'MarkedOpen' }
|
||||
Plug 'tpope/vim-markdown', { 'for': 'markdown' }
|
||||
Plug 'fatih/vim-go', { 'for': 'go' }
|
||||
Plug 'timcharper/textile.vim', { 'for': 'textile' }
|
||||
" Plug 'tclem/vim-arduino'
|
||||
" Plug 'davidoc/taskpaper.vim'
|
||||
|
||||
call plug#end()
|
||||
filetype plugin indent on
|
||||
@@ -1,243 +0,0 @@
|
||||
# Global snippets
|
||||
|
||||
# (c) holds no legal value ;)
|
||||
snippet c)
|
||||
Copyright `&enc[:2] == "utf" ? "©" : "(c)"` `strftime("%Y")` ${1:`g:snips_author`}. All Rights Reserved.${2}
|
||||
snippet date
|
||||
`strftime("%Y-%m-%d")`
|
||||
snippet ddate
|
||||
`strftime("%B %d, %Y")`
|
||||
snippet time
|
||||
`strftime("%H:%M")`
|
||||
snippet datetime
|
||||
`strftime("%Y-%m-%d %H:%M")`
|
||||
snippet rref
|
||||
refs:#`git rev-parse --abrev-ref HEAD | sed 's/ticket-//'`
|
||||
snippet lorem
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
snippet GPL2
|
||||
${1:One line to give the program's name and a brief description.}
|
||||
Copyright (C) `strftime("%Y")` ${2:copyright holder}
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
${3}
|
||||
snippet LGPL2
|
||||
${1:One line to give the program's name and a brief description.}
|
||||
Copyright (C) `strftime("%Y")` ${2:copyright holder}
|
||||
|
||||
This library is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published
|
||||
by the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
${3}
|
||||
snippet GPL3
|
||||
${1:one line to give the program's name and a brief description.}
|
||||
Copyright (C) `strftime("%Y")` ${2:copyright holder}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
${3}
|
||||
snippet LGPL3
|
||||
${1:One line to give the program's name and a brief description.}
|
||||
Copyright (C) `strftime("%Y")` ${2:copyright holder}
|
||||
|
||||
This library is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published
|
||||
by the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
${3}
|
||||
snippet BSD2
|
||||
${1:one line to give the program's name and a brief description}
|
||||
Copyright (C) `strftime("%Y")` ${2:copyright holder}
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY $2 ''AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL $2 BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
The views and conclusions contained in the software and documentation
|
||||
are those of the authors and should not be interpreted as representing
|
||||
official policies, either expressedor implied, of $2.
|
||||
|
||||
${4}
|
||||
snippet BSD3
|
||||
${1:one line to give the program's name and a brief description}
|
||||
Copyright (C) `strftime("%Y")` ${2:copyright holder}
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. Neither the name of the ${3:organization} nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY $2 ''AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL $2 BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
${4}
|
||||
snippet BSD4
|
||||
${1:one line to give the program's name and a brief description}
|
||||
Copyright (C) `strftime("%Y")` ${2:copyright holder}
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
3. All advertising materials mentioning features or use of this software
|
||||
must display the following acknowledgement:
|
||||
This product includes software developed by the ${3:organization}.
|
||||
4. Neither the name of the $3 nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY $2 ''AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL $2 BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
${4}
|
||||
snippet MIT
|
||||
${1:one line to give the program's name and a brief description}
|
||||
Copyright (C) `strftime("%Y")` ${2:copyright holder}
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
${3}
|
||||
snippet APACHE
|
||||
${1:one line to give the program's name and a brief description}
|
||||
Copyright `strftime("%Y")` ${2:copyright holder}
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
${3}
|
||||
snippet BEERWARE
|
||||
${2:one line to give the program's name and a brief description}
|
||||
Copyright `strftime("%Y")` ${3:copyright holder}
|
||||
|
||||
Licensed under the "THE BEER-WARE LICENSE" (Revision 42):
|
||||
${1:`g:snips_author`} wrote this file. As long as you retain this notice you
|
||||
can do whatever you want with this stuff. If we meet some day, and you think
|
||||
this stuff is worth it, you can buy me a beer or coffee in return
|
||||
|
||||
${4}
|
||||
|
||||
snippet WTFPL
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright `strftime("%Y")` ${1:copyright holder}
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||
@@ -1,6 +0,0 @@
|
||||
# skip jshint checking on push
|
||||
snippet jsh
|
||||
!skip_jshint
|
||||
# add ticket number to commit
|
||||
snippet ref
|
||||
refs:#${1}
|
||||
@@ -1,51 +0,0 @@
|
||||
snippet attach
|
||||
data-dojo-attach-point="${1}"
|
||||
snippet type
|
||||
data-dojo-type="${1}"
|
||||
snippet dtestcase
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.10.2/dijit/themes/claro/claro.css">
|
||||
</head>
|
||||
<body class="claro">
|
||||
<div id="main"></div>
|
||||
<script>
|
||||
var dojoConfig = {
|
||||
async: true,
|
||||
isDebug: true,
|
||||
packages: [
|
||||
{ name: 'dgrid', location: '//cdn.rawgit.com/SitePen/dgrid/v0.3.16' },
|
||||
{ name: 'xstyle', location:'//cdn.rawgit.com/kriszyp/xstyle/v0.2.1' },
|
||||
{ name: 'put-selector', location: '//cdn.rawgit.com/kriszyp/put-selector/v0.3.5' }
|
||||
]
|
||||
};
|
||||
</script>
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.10.2/dojo/dojo.js"></script>
|
||||
<script>
|
||||
${1}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
snippet dsupport
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<script data-dojo-config="async:1,isDebug:1" src="../../dojo/dojo.js"></script>
|
||||
<script>
|
||||
${1}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
snippet viewport
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
snippet dojocdn
|
||||
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.10.2/dojo/dojo.js"></script>
|
||||
snippet clarocdn
|
||||
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.10.2/dijit/themes/claro/claro.css">
|
||||
@@ -1,82 +0,0 @@
|
||||
# dojo/AMD snippets
|
||||
snippet def
|
||||
define([
|
||||
${1}
|
||||
], function (${2}) {
|
||||
});
|
||||
snippet dec
|
||||
declare(${1}, {
|
||||
});
|
||||
snippet req
|
||||
require([
|
||||
${1}
|
||||
], function (${2}) {
|
||||
});
|
||||
snippet inh
|
||||
this.inherited(arguments);
|
||||
# basic snippets
|
||||
snippet :
|
||||
${1:key}: ${2:value}
|
||||
snippet :f
|
||||
${1:method_name}: function (${2:args}) {
|
||||
}
|
||||
snippet fn
|
||||
function () {
|
||||
}
|
||||
snippet fun
|
||||
function ${1:name}(${2:args}) {
|
||||
}
|
||||
snippet iife
|
||||
(function () {
|
||||
${1}
|
||||
})();
|
||||
snippet interval
|
||||
setInterval(function () {
|
||||
${2}
|
||||
}, ${1});
|
||||
snippet timeout
|
||||
setTimeout(function () {
|
||||
${2}
|
||||
}, ${1});
|
||||
# log snippets
|
||||
snippet log
|
||||
console.log(${1});
|
||||
snippet lred
|
||||
console.log('%c${1}', 'font-weight:bold;color:red;');
|
||||
snippet lgreen
|
||||
console.log('%c${1}', 'font-weight:bold;color:green;');
|
||||
snippet lblue
|
||||
console.log('%c${1}', 'font-weight:bold;color:blue;');
|
||||
snippet lpurple
|
||||
console.log('%c${1}', 'font-weight:bold;color:purple;');
|
||||
snippet lor
|
||||
console.log('%c${1}', 'font-weight:bold;color:orange;');
|
||||
snippet ctab
|
||||
console.table(${1});
|
||||
snippet debug
|
||||
console.log('[DEBUG] ${1}');
|
||||
snippet trace
|
||||
console.trace();
|
||||
snippet des
|
||||
describe('${1}', function () {
|
||||
});
|
||||
snippet it
|
||||
it('${1}', function () {
|
||||
});
|
||||
# dojo snippets
|
||||
snippet widget
|
||||
define([
|
||||
'dojo/_base/declare',
|
||||
'dijit/_WidgetBase',
|
||||
'dijit/_TemplatedMixin',
|
||||
'dijit/_WidgetsInTemplateMixin',
|
||||
'dojo/text!./templates/${1}.html'
|
||||
], function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, template) {
|
||||
return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
|
||||
templateString: template
|
||||
});
|
||||
});
|
||||
snippet doc
|
||||
/**
|
||||
* ${1}
|
||||
*/
|
||||
@@ -1,3 +0,0 @@
|
||||
snippet code
|
||||
\`\`\`${1}
|
||||
\`\`\`
|
||||
@@ -1,4 +0,0 @@
|
||||
snippet code
|
||||
<pre><code class="${1:javascript}">
|
||||
${2}
|
||||
</code></pre>
|
||||
@@ -1,90 +0,0 @@
|
||||
snippet ref
|
||||
/// <reference path="${1}"/>
|
||||
snippet des
|
||||
describe('${1}', () => {
|
||||
});
|
||||
snippet it
|
||||
it('${1}', () => {
|
||||
});
|
||||
# dojo/AMD snippets
|
||||
snippet def
|
||||
define([
|
||||
${1}
|
||||
], function (${2}) {
|
||||
});
|
||||
snippet dec
|
||||
declare(${1}, {
|
||||
});
|
||||
snippet req
|
||||
require([
|
||||
${1}
|
||||
], function (${2}) {
|
||||
});
|
||||
snippet inh
|
||||
this.inherited(arguments);
|
||||
# basic snippets
|
||||
snippet :
|
||||
${1:key}: ${2:value}
|
||||
snippet :f
|
||||
${1:method_name}: function (${2:args}) {
|
||||
}
|
||||
snippet fn
|
||||
function () {
|
||||
}
|
||||
snippet fun
|
||||
function ${1:name}(${2:args}) {
|
||||
}
|
||||
snippet iife
|
||||
(function () {
|
||||
${1}
|
||||
})();
|
||||
snippet interval
|
||||
setInterval(function () {
|
||||
${2}
|
||||
}, ${1});
|
||||
snippet timeout
|
||||
setTimeout(function () {
|
||||
${2}
|
||||
}, ${1});
|
||||
# log snippets
|
||||
snippet log
|
||||
console.log(${1});
|
||||
snippet lred
|
||||
console.log('%c${1}', 'font-weight:bold;color:red;');
|
||||
snippet lgreen
|
||||
console.log('%c${1}', 'font-weight:bold;color:green;');
|
||||
snippet lblue
|
||||
console.log('%c${1}', 'font-weight:bold;color:blue;');
|
||||
snippet lpurple
|
||||
console.log('%c${1}', 'font-weight:bold;color:purple;');
|
||||
snippet lor
|
||||
console.log('%c${1}', 'font-weight:bold;color:orange;');
|
||||
snippet ctab
|
||||
console.table(${1});
|
||||
snippet debug
|
||||
console.log('[DEBUG] ${1}');
|
||||
snippet trace
|
||||
console.trace();
|
||||
snippet des
|
||||
describe('${1}', function () {
|
||||
});
|
||||
snippet it
|
||||
it('${1}', function () {
|
||||
});
|
||||
# dojo snippets
|
||||
snippet widget
|
||||
define([
|
||||
'dojo/_base/declare',
|
||||
'dijit/_WidgetBase',
|
||||
'dijit/_TemplatedMixin',
|
||||
'dijit/_WidgetsInTemplateMixin',
|
||||
'dojo/text!./templates/${1}.html'
|
||||
], function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, template) {
|
||||
return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
|
||||
templateString: template
|
||||
});
|
||||
});
|
||||
snippet doc
|
||||
/**
|
||||
* ${1}
|
||||
*/
|
||||
@@ -1,2 +0,0 @@
|
||||
snippet bun
|
||||
Bundle '${1}'
|
||||
@@ -1,468 +0,0 @@
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => General
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
" load plugins from vundle
|
||||
source ~/.vim/plugins.vim
|
||||
|
||||
" Abbreviations
|
||||
abbr funciton function
|
||||
abbr teh the
|
||||
abbr tempalte template
|
||||
abbr fitler filter
|
||||
|
||||
set nocompatible " not compatible with vi
|
||||
set autoread " detect when a file is changed
|
||||
|
||||
" make backspace behave in a sane manner
|
||||
set backspace=indent,eol,start
|
||||
|
||||
" set a map leader for more key combos
|
||||
let mapleader = ','
|
||||
let g:mapleader = ','
|
||||
|
||||
set history=1000 " change history to 1000
|
||||
set textwidth=120
|
||||
|
||||
" Tab control
|
||||
set noexpandtab " insert tabs rather than spaces for <Tab>
|
||||
set smarttab " tab respects 'tabstop', 'shiftwidth', and 'softtabstop'
|
||||
set tabstop=4 " the visible width of tabs
|
||||
set softtabstop=4 " edit as if the tabs are 4 characters wide
|
||||
set shiftwidth=4 " number of spaces to use for indent and unindent
|
||||
set shiftround " round indent to a multiple of 'shiftwidth'
|
||||
set completeopt+=longest
|
||||
|
||||
if has('mouse')
|
||||
set mouse=a
|
||||
set ttymouse=xterm2
|
||||
endif
|
||||
|
||||
set clipboard=unnamed
|
||||
|
||||
" faster redrawing
|
||||
set ttyfast
|
||||
|
||||
" highlight conflicts
|
||||
match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$'
|
||||
|
||||
" file type specific settings
|
||||
if has('autocmd') && !exists('autocommands_loaded')
|
||||
let autocommands_loaded = 1
|
||||
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
|
||||
autocmd FileType make setlocal ts=8 sts=8 sw=8 noexpandtab
|
||||
autocmd FileType ruby setlocal ts=2 sts=2 sw=2 expandtab
|
||||
autocmd FileType html setlocal ts=4 sts=4 sw=4 noexpandtab indentkeys-=*<return>
|
||||
autocmd FileType jade setlocal ts=2 sts=2 sw=2 noexpandtab
|
||||
autocmd FileType *.md.js :call SyntasticReset<cr>
|
||||
autocmd FileType markdown,textile setlocal textwidth=0 wrapmargin=0 wrap spell
|
||||
autocmd FileType .xml exe ":silent %!xmllint --format --recover - 2>/dev/null"
|
||||
autocmd FileType crontab setlocal nobackup nowritebackup
|
||||
"autocmd WinEnter * setlocal cursorline
|
||||
"autocmd WinLeave * setlocal nocursorline
|
||||
|
||||
" automatically resize panes on resize
|
||||
autocmd VimResized * exe 'normal! \<c-w>='
|
||||
autocmd BufWritePost .vimrc source %
|
||||
autocmd BufWritePost .vimrc.local source %
|
||||
" save all files on focus lost, ignoring warnings about untitled buffers
|
||||
autocmd FocusLost * silent! wa
|
||||
|
||||
autocmd BufNewFile,BufRead *.ejs set filetype=html
|
||||
autocmd BufNewFile,BufRead *.ino set filetype=c
|
||||
autocmd BufNewFile,BufRead *.svg set filetype=xml
|
||||
|
||||
" make quickfix windows take all the lower section of the screen when there
|
||||
" are multiple windows open
|
||||
autocmd FileType qf wincmd J
|
||||
|
||||
autocmd BufNewFile,BufReadPost *.md set filetype=markdown
|
||||
let g:markdown_fenced_languages = ['css', 'javascript', 'js=javascript', 'json=javascript', 'stylus', 'html']
|
||||
|
||||
" autocmd! BufEnter * call ApplyLocalSettings(expand('<afile>:p:h'))
|
||||
endif
|
||||
|
||||
" code folding settings
|
||||
set foldmethod=syntax " fold based on indent
|
||||
set foldnestmax=10 " deepest fold is 10 levels
|
||||
set nofoldenable " don't fold by default
|
||||
set foldlevel=1
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => User Interface
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
set so=7 " set 7 lines to the cursors - when moving vertical
|
||||
set wildmenu " enhanced command line completion
|
||||
set hidden " current buffer can be put into background
|
||||
set showcmd " show incomplete commands
|
||||
set noshowmode " don't show which mode disabled for PowerLine
|
||||
set wildmode=list:longest " complete files like a shell
|
||||
set scrolloff=3 " lines of text around cursor
|
||||
set shell=$SHELL
|
||||
set cmdheight=1 " command bar height
|
||||
|
||||
set title " set terminal title
|
||||
|
||||
" Searching
|
||||
set ignorecase " case insensitive searching
|
||||
set smartcase " case-sensitive if expresson contains a capital letter
|
||||
set hlsearch
|
||||
set incsearch " set incremental search, like modern browsers
|
||||
set nolazyredraw " don't redraw while executing macros
|
||||
|
||||
set magic " Set magic on, for regex
|
||||
|
||||
set showmatch " show matching braces
|
||||
set mat=2 " how many tenths of a second to blink
|
||||
|
||||
" error bells
|
||||
set noerrorbells
|
||||
set visualbell
|
||||
set t_vb=
|
||||
set tm=500
|
||||
|
||||
" switch syntax highlighting on
|
||||
syntax on
|
||||
|
||||
set encoding=utf8
|
||||
let base16colorspace=256 " Access colors present in 256 colorspace"
|
||||
set t_Co=256 " Explicitly tell vim that the terminal supports 256 colors"
|
||||
execute "set background=".$BACKGROUND
|
||||
execute "colorscheme ".$THEME
|
||||
|
||||
" set number " show line numbers
|
||||
" set relativenumber " show relative line numbers
|
||||
set number " show the current line number"
|
||||
|
||||
set wrap "turn on line wrapping
|
||||
set wrapmargin=8 " wrap lines when coming within n characters from side
|
||||
set linebreak " set soft wrapping
|
||||
set showbreak=… " show ellipsis at breaking
|
||||
|
||||
set autoindent " automatically set indent of new line
|
||||
set smartindent
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Files, backups, and undo
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
"set nobackup
|
||||
"set nowritebackup
|
||||
"set noswapfile
|
||||
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
|
||||
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => StatusLine
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
set laststatus=2 " show the satus line all the time
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Mappings
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" General mappings/shortcuts for functionality
|
||||
" Additional, plugin-specific mappings are located under
|
||||
" the plugins section
|
||||
|
||||
" Close the current buffer
|
||||
" noremap <C-x> :q<cr>
|
||||
|
||||
" remap esc
|
||||
inoremap jk <esc>
|
||||
|
||||
" markdown to html
|
||||
nmap <leader>md :%!markdown --html4tags <cr>
|
||||
|
||||
" remove extra whitespace
|
||||
nmap <leader><space> :%s/\s\+$<cr>
|
||||
|
||||
" wipout buffer
|
||||
nmap <silent> <leader>b :bw<cr>
|
||||
|
||||
" shortcut to save
|
||||
nmap <leader>, :w<cr>
|
||||
|
||||
" disable Ex mode
|
||||
noremap Q <NOP>
|
||||
|
||||
" set paste toggle
|
||||
set pastetoggle=<F6>
|
||||
|
||||
" toggle paste mode
|
||||
map <leader>v :set paste!<cr>
|
||||
|
||||
" edit ~/.vimrc
|
||||
map <leader>ev :e! ~/.vimrc<cr>
|
||||
" edit vim plugins
|
||||
map <leader>evp :e! ~/.vim/plugins.vim<cr>
|
||||
" edit vim functions
|
||||
map <leader>evf :e! ~/.vim/functions.vim<cr>
|
||||
" edit gitconfig
|
||||
map <leader>eg :e! ~/.gitconfig<cr>
|
||||
|
||||
" clear highlighted search
|
||||
noremap <space> :set hlsearch! hlsearch?<cr>
|
||||
|
||||
" activate spell-checking alternatives
|
||||
nmap ;s :set invspell spelllang=en<cr>
|
||||
|
||||
" toggle invisible characters
|
||||
set invlist
|
||||
set listchars=tab:▸\ ,eol:¬,trail:⋅,extends:❯,precedes:❮
|
||||
highlight SpecialKey ctermbg=none " make the highlighting of tabs less annoying
|
||||
set showbreak=↪
|
||||
nmap <leader>l :set list!<cr>
|
||||
|
||||
" Textmate style indentation
|
||||
vmap <leader>[ <gv
|
||||
vmap <leader>] >gv
|
||||
nmap <leader>[ <<
|
||||
nmap <leader>] >>
|
||||
|
||||
" switch between current and last buffer
|
||||
nmap <leader>. <c-^>
|
||||
|
||||
" enable . command in visual mode
|
||||
vnoremap . :normal .<cr>
|
||||
|
||||
map <silent> <C-h> :call WinMove('h')<cr>
|
||||
map <silent> <C-j> :call WinMove('j')<cr>
|
||||
map <silent> <C-k> :call WinMove('k')<cr>
|
||||
map <silent> <C-l> :call WinMove('l')<cr>
|
||||
|
||||
map <leader>wc :wincmd q<cr>
|
||||
|
||||
" toggle cursor line
|
||||
nnoremap <leader>i :set cursorline!<cr>
|
||||
|
||||
" scroll the viewport faster
|
||||
nnoremap <C-e> 3<C-e>
|
||||
nnoremap <C-y> 3<C-y>
|
||||
|
||||
" moving up and down work as you would expect
|
||||
nnoremap <silent> j gj
|
||||
nnoremap <silent> k gk
|
||||
nnoremap <silent> ^ g^
|
||||
nnoremap <silent> $ g$
|
||||
|
||||
" search for word under the cursor
|
||||
nnoremap <leader>/ "fyiw :/<c-r>f<cr>
|
||||
|
||||
" inoremap <tab> <c-r>=Smart_TabComplete()<CR>
|
||||
|
||||
map <leader>r :call RunCustomCommand()<cr>
|
||||
" map <leader>s :call SetCustomCommand()<cr>
|
||||
let g:silent_custom_command = 0
|
||||
|
||||
" helpers for dealing with other people's code
|
||||
nmap \t :set ts=4 sts=4 sw=4 noet<cr>
|
||||
nmap \s :set ts=4 sts=4 sw=4 et<cr>
|
||||
|
||||
nmap <leader>w :setf textile<cr> :Goyo<cr>
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Functions
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
" Window movement shortcuts
|
||||
" move to the window in the direction shown, or create a new window
|
||||
function! WinMove(key)
|
||||
let t:curwin = winnr()
|
||||
exec "wincmd ".a:key
|
||||
if (t:curwin == winnr())
|
||||
if (match(a:key,'[jk]'))
|
||||
wincmd v
|
||||
else
|
||||
wincmd s
|
||||
endif
|
||||
exec "wincmd ".a:key
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" recursively search up from dirname, sourcing all .vimrc.local files along the way
|
||||
function! ApplyLocalSettings(dirname)
|
||||
" convert windows paths to unix style
|
||||
let l:curDir = substitute(a:dirname, '\\', '/', 'g')
|
||||
|
||||
" walk to the top of the dir tree
|
||||
let l:parentDir = strpart(l:curDir, 0, strridx(l:curDir, '/'))
|
||||
if isdirectory(l:parentDir)
|
||||
call ApplyLocalSettings(l:parentDir)
|
||||
endif
|
||||
|
||||
" now walk back down the path and source .vimsettings as you find them.
|
||||
" child directories can inherit from their parents
|
||||
let l:settingsFile = a:dirname . '/.vimrc.local'
|
||||
if filereadable(l:settingsFile)
|
||||
exec ':source' . l:settingsFile
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" smart tab completion
|
||||
function! Smart_TabComplete()
|
||||
let line = getline('.') " current line
|
||||
|
||||
let substr = strpart(line, -1, col('.')+1) " from the start of the current
|
||||
" line to one character right
|
||||
" of the cursor
|
||||
let substr = matchstr(substr, '[^ \t]*$') " word till cursor
|
||||
if (strlen(substr)==0) " nothing to match on empty string
|
||||
return '\<tab>'
|
||||
endif
|
||||
let has_period = match(substr, '\.') != -1 " position of period, if any
|
||||
let has_slash = match(substr, '\/') != -1 " position of slash, if any
|
||||
if (!has_period && !has_slash)
|
||||
return '\<C-X>\<C-P>' " existing text matching
|
||||
elseif ( has_slash )
|
||||
return '\<C-X>\<C-F>' " file matching
|
||||
else
|
||||
return '\<C-X>\<C-O>' " plugin matching
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" execute a custom command
|
||||
function! RunCustomCommand()
|
||||
up
|
||||
if g:silent_custom_command
|
||||
execute 'silent !' . s:customcommand
|
||||
else
|
||||
execute '!' . s:customcommand
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! SetCustomCommand()
|
||||
let s:customcommand = input('Enter Custom Command$ ')
|
||||
endfunction
|
||||
|
||||
function! TrimWhiteSpace()
|
||||
%s/\s\+$//e
|
||||
endfunction
|
||||
|
||||
function! HiInterestingWord(n)
|
||||
" Save our location.
|
||||
normal! mz
|
||||
|
||||
" Yank the current word into the z register.
|
||||
normal! "zyiw
|
||||
|
||||
" Calculate an arbitrary match ID. Hopefully nothing else is using it.
|
||||
let mid = 86750 + a:n
|
||||
|
||||
" Clear existing matches, but don't worry if they don't exist.
|
||||
silent! call matchdelete(mid)
|
||||
|
||||
" Construct a literal pattern that has to match at boundaries.
|
||||
let pat = '\V\<' . escape(@z, '\') . '\>'
|
||||
|
||||
" Actually match the words.
|
||||
call matchadd("InterestingWord" . a:n, pat, 1, mid)
|
||||
|
||||
" Move back to our original location.
|
||||
normal! `z
|
||||
endfunction
|
||||
|
||||
nnoremap <silent> <leader>1 :call HiInterestingWord(1)<cr>
|
||||
nnoremap <silent> <leader>2 :call HiInterestingWord(2)<cr>
|
||||
nnoremap <silent> <leader>3 :call HiInterestingWord(3)<cr>
|
||||
nnoremap <silent> <leader>4 :call HiInterestingWord(4)<cr>
|
||||
nnoremap <silent> <leader>5 :call HiInterestingWord(5)<cr>
|
||||
nnoremap <silent> <leader>6 :call HiInterestingWord(6)<cr>
|
||||
|
||||
hi def InterestingWord1 guifg=#000000 ctermfg=16 guibg=#ffa724 ctermbg=214
|
||||
hi def InterestingWord2 guifg=#000000 ctermfg=16 guibg=#aeee00 ctermbg=154
|
||||
hi def InterestingWord3 guifg=#000000 ctermfg=16 guibg=#8cffba ctermbg=121
|
||||
hi def InterestingWord4 guifg=#000000 ctermfg=16 guibg=#b88853 ctermbg=137
|
||||
hi def InterestingWord5 guifg=#000000 ctermfg=16 guibg=#ff9eb8 ctermbg=211
|
||||
hi def InterestingWord6 guifg=#000000 ctermfg=16 guibg=#ff2c4b ctermbg=195
|
||||
|
||||
function! HtmlUnEscape()
|
||||
silent s/</</eg
|
||||
silent s/>/>/eg
|
||||
silent s/&/\&/eg
|
||||
endfunction
|
||||
|
||||
nnoremap <silent> <leader>u :call HtmlUnEscape()<cr>
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Plugins
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
" close NERDTree after a file is opened
|
||||
let g:NERDTreeQuitOnOpen=0
|
||||
" show hidden files in NERDTree
|
||||
let NERDTreeShowHidden=1
|
||||
" remove some files by extension
|
||||
let NERDTreeIgnore = ['\.js.map$']
|
||||
" Toggle NERDTree
|
||||
nmap <silent> <leader>k :NERDTreeToggle<cr>
|
||||
" expand to the path of the file in the current buffer
|
||||
nmap <silent> <leader>y :NERDTreeFind<cr>
|
||||
|
||||
" map fuzzyfinder (CtrlP) plugin
|
||||
" nmap <silent> <leader>t :CtrlP<cr>
|
||||
nmap <silent> <leader>r :CtrlPBuffer<cr>
|
||||
let g:ctrlp_map='<leader>t'
|
||||
let g:ctrlp_dotfiles=1
|
||||
let g:ctrlp_working_path_mode = 'ra'
|
||||
|
||||
" Fugitive Shortcuts
|
||||
nmap <silent> <leader>gs :Gstatus<cr>
|
||||
nmap <leader>ge :Gedit<cr>
|
||||
nmap <silent><leader>gr :Gread<cr>
|
||||
nmap <silent><leader>gb :Gblame<cr>
|
||||
|
||||
nmap <leader>m :MarkedOpen!<cr>
|
||||
nmap <leader>mq :MarkedQuit<cr>
|
||||
|
||||
" toggle syntastic
|
||||
nmap <leader>s :SyntasticToggleMode<cr>
|
||||
|
||||
" toggle Limelight
|
||||
nmap <leader>f :Limelight!!<cr>
|
||||
|
||||
" allow es5 mode when looking at TypeScript
|
||||
let g:syntastic_typescript_tsc_args = '--module amd --target ES5 --noImplicitAny'
|
||||
let g:syntastic_typescript_checkers = ['tslint']
|
||||
let g:syntastic_javascript_checkers = ['jshint', 'jscs']
|
||||
let g:syntastic_error_symbol='✗'
|
||||
let g:syntastic_warning_symbol='⚠'
|
||||
|
||||
" CtrlP ignore patterns
|
||||
" let g:ctrlp_custom_ignore = {
|
||||
" \ 'dir': '\.git$\|node_modules$\|bower_components$\|\.hg$\|\.svn$',
|
||||
" \ 'file': '\.exe$\|\.so$'
|
||||
" \ }
|
||||
" only show files that are not ignored by git
|
||||
let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
|
||||
|
||||
" search the nearest ancestor that contains .git, .hg, .svn
|
||||
let g:ctrlp_working_path_mode = 2
|
||||
|
||||
|
||||
" airline options
|
||||
let g:airline_powerline_fonts=1
|
||||
let g:airline_left_sep=''
|
||||
let g:airline_right_sep=''
|
||||
let g:airline_theme='base16'
|
||||
|
||||
" don't hide quotes in json files
|
||||
let g:vim_json_syntax_conceal = 0
|
||||
|
||||
|
||||
let g:SuperTabCrMapping = 0
|
||||
|
||||
if (has("gui_running"))
|
||||
set guioptions=egmrt
|
||||
set background=light
|
||||
colorscheme solarized
|
||||
let g:airline_left_sep=''
|
||||
let g:airline_right_sep=''
|
||||
let g:airline_powerline_fonts=0
|
||||
let g:airline_theme='solarized'
|
||||
endif
|
||||
|
||||
call ApplyLocalSettings(expand('.'))
|
||||
Reference in New Issue
Block a user