[nvim] simplify conf and add latex support
This commit is contained in:
parent
7478fee064
commit
661ae62d3c
8
vim/.config/nvim/init.vim
Executable file
8
vim/.config/nvim/init.vim
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
" ==================================================
|
||||||
|
" Source the files ~/.vim/rc.d/
|
||||||
|
" ==================================================
|
||||||
|
for f in split(glob('~/.vim/rc.d/*.vim'), '\n')
|
||||||
|
exe 'source' f
|
||||||
|
endfor
|
||||||
|
|
||||||
|
" vim:set et sw=2:
|
@ -1,197 +0,0 @@
|
|||||||
My Neovim setup
|
|
||||||
===============
|
|
||||||
|
|
||||||
My Neovim IDE setup for Python, Go, Rust, HTML, CSS, Javascript, Typescript,
|
|
||||||
gettext and more.
|
|
||||||
|
|
||||||
Features
|
|
||||||
---------
|
|
||||||
|
|
||||||
* `init.vim` handling
|
|
||||||
* Incremental and smart case search.
|
|
||||||
* Sublime Text style multiple selections
|
|
||||||
* Trailing whitespace highlighting and cleaning shortcut
|
|
||||||
* Logical and Visual layout (for Right-To-Left lanaguegs) editing.
|
|
||||||
* Tabs expand to 4 spaces by default
|
|
||||||
* Remap `<Leader>` to `<SPACE>` and `jj` to `<ESC>`
|
|
||||||
* Highlight current row and color column 80
|
|
||||||
* 70+ language packs support
|
|
||||||
* Syntax checking
|
|
||||||
* Snippets
|
|
||||||
* Quotes, parens etc pair, surround
|
|
||||||
* Extended pair matching with %
|
|
||||||
* ASCII drawing
|
|
||||||
* Fuzzy file, buffer, mru, tag, etc finder
|
|
||||||
* VCS plugins (Fugitive, Lawrencium)
|
|
||||||
* Tab completion
|
|
||||||
* Commenting
|
|
||||||
|
|
||||||
Prerequisites
|
|
||||||
-------------
|
|
||||||
|
|
||||||
- Neovim and Neovim Python client.
|
|
||||||
- For faster search, [ripgrep](https://github.com/BurntSushi/ripgrep)
|
|
||||||
- For tags: [ctags](http://ctags.sourceforge.net)
|
|
||||||
- For devicons, a patched font, like the one from
|
|
||||||
[nerd-fonts](https://github.com/ryanoasis/nerd-fonts)
|
|
||||||
|
|
||||||
Usage
|
|
||||||
------------
|
|
||||||
|
|
||||||
The following commands will clone the repo, and install `vim-plug` plugin
|
|
||||||
manager:
|
|
||||||
|
|
||||||
mkdir -p ~/.config/nvim
|
|
||||||
git clone https://github.com/MeirKriheli/dotneovim.git ~/.config/nvim
|
|
||||||
curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \
|
|
||||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
||||||
|
|
||||||
|
|
||||||
Install plugins from the command line:
|
|
||||||
|
|
||||||
nvim +PlugUpdate +qa
|
|
||||||
|
|
||||||
|
|
||||||
After that, [install the desired COC plugins or extensions](https://github.com/neoclide/coc.nvim).
|
|
||||||
|
|
||||||
Overrides
|
|
||||||
----------------
|
|
||||||
|
|
||||||
* `~/.config/nvim/before.vim`, if exists, is sourced before everything allowing
|
|
||||||
definitions of variables to act upon.
|
|
||||||
* `~/.config/nvim/after.vim` if exists, is sourced after all the files in
|
|
||||||
`~/.config/nvim/rc.d` allowing override of default settings (e.g: color
|
|
||||||
schemes, plugin configuration, etc.).
|
|
||||||
|
|
||||||
|
|
||||||
Go tags
|
|
||||||
----------
|
|
||||||
|
|
||||||
For CtrlPBufTag search in go files, make sure you have an updated version
|
|
||||||
of ``ctags`` (>=5.8) and put in your ``~/.ctags``::
|
|
||||||
|
|
||||||
--langdef=Go
|
|
||||||
--langmap=Go:.go
|
|
||||||
--regex-Go=/func([ \t]+\([^)]+\))?[ \t]+([a-zA-Z0-9_]+)/\2/f,func/
|
|
||||||
--regex-Go=/var[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/v,var/
|
|
||||||
--regex-Go=/type[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/t,type/
|
|
||||||
|
|
||||||
|
|
||||||
Rust tags
|
|
||||||
-------------------------
|
|
||||||
|
|
||||||
For Rust ctags to wok (e.g: TagBar), put in your ``~/.ctags``::
|
|
||||||
|
|
||||||
--langdef=Rust
|
|
||||||
--langmap=Rust:.rs
|
|
||||||
--regex-Rust=/^[ \t]*(#\[[^\]]\][ \t]*)*(pub[ \t]+)?(extern[ \t]+)?("[^"]+"[ \t]+)?(unsafe[ \t]+)?fn[ \t]+([a-zA-Z0-9_]+)/\6/f,functions,function definitions/
|
|
||||||
--regex-Rust=/^[ \t]*(pub[ \t]+)?type[ \t]+([a-zA-Z0-9_]+)/\2/T,types,type definitions/
|
|
||||||
--regex-Rust=/^[ \t]*(pub[ \t]+)?enum[ \t]+([a-zA-Z0-9_]+)/\2/g,enum,enumeration names/
|
|
||||||
--regex-Rust=/^[ \t]*(pub[ \t]+)?struct[ \t]+([a-zA-Z0-9_]+)/\2/s,structure names/
|
|
||||||
--regex-Rust=/^[ \t]*(pub[ \t]+)?mod[ \t]+([a-zA-Z0-9_]+)/\2/m,modules,module names/
|
|
||||||
--regex-Rust=/^[ \t]*(pub[ \t]+)?(static|const)[ \t]+(mut[ \t]+)?([a-zA-Z0-9_]+)/\4/c,consts,static constants/
|
|
||||||
--regex-Rust=/^[ \t]*(pub[ \t]+)?(unsafe[ \t]+)?trait[ \t]+([a-zA-Z0-9_]+)/\3/t,traits,traits/
|
|
||||||
--regex-Rust=/^[ \t]*(pub[ \t]+)?(unsafe[ \t]+)?impl([ \t\n]*<[^>]*>)?[ \t]+(([a-zA-Z0-9_:]+)[ \t]*(<[^>]*>)?[ \t]+(for)[ \t]+)?([a-zA-Z0-9_]+)/\5 \7 \8/i,impls,trait implementations/
|
|
||||||
--regex-Rust=/^[ \t]*macro_rules![ \t]+([a-zA-Z0-9_]+)/\1/d,macros,macro definitions/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Plugins
|
|
||||||
------------
|
|
||||||
|
|
||||||
* [Solarized](https://github.com/altercation/vim-colors-solarized) - color
|
|
||||||
scheme
|
|
||||||
* [base16-vim](https://github.com/chriskempson/base16-vim) - color scheme
|
|
||||||
* [vim-molokai](https://github.com/tomasr/molokai) - color scheme
|
|
||||||
* [Oceanic-next](https://github.com/mhartington/oceanic-next) - color scheme
|
|
||||||
* [Nord VIM](https://github.com/arcticicestudio/nord-vim) - color scheme
|
|
||||||
* [Gruvbox](https://github.com/morhetz/gruvbox) - color scheme
|
|
||||||
* [Fugitive](https://github.com/tpope/vim-fugitive) - a Git wrapper so awesome,
|
|
||||||
it should be illegal
|
|
||||||
* [gv.vim](https://github.com/junegunn/gv.vim) - A git commit browser in Vim
|
|
||||||
* [Lawrencium](https://github.com/ludovicchabant/vim-lawrencium) - Mercurial
|
|
||||||
wrapper for Vim, inspired by Tim Pope's Fugitive
|
|
||||||
* [ctrlp.vim](https://github.com/ctrlpvim/ctrlp.vim) - Fuzzy file, buffer, mru,
|
|
||||||
tag, etc finder
|
|
||||||
* [ale](https://github.com/w0rp/ale) - Asynchronous Lint Engine
|
|
||||||
* [coc.nvim](https://github.com/neoclide/coc.nvim) - Intellisense engine for
|
|
||||||
vim8 & neovim, full language server protocol support as VSCode
|
|
||||||
* [UltiSnips](https://github.com/sirver/ultisnips) - The ultimate snippet
|
|
||||||
solution for Vim.
|
|
||||||
* [vim-snippets](https://github.com/honza/vim-snippets) - vim-snipmate default
|
|
||||||
snippets
|
|
||||||
* [python-mode](https://github.com/klen/python-mode) - Vim python-mode. PyLint,
|
|
||||||
Rope, Pydoc, breakpoints from box
|
|
||||||
* [vim-go](https://github.com/fatih/vim-go) - Go development plugin for Vim
|
|
||||||
* [rust.vim](https://github.com/rust-lang/rust.vim) - provides Rust file
|
|
||||||
detection, syntax highlighting, formatting, Syntastic integration, and more.
|
|
||||||
* [DrawIt](https://github.com/vim-scripts/DrawIt) - ASCII drawing plugin:
|
|
||||||
lines, ellipses, arrows, fills, and more!
|
|
||||||
* [vim-surround](https://github.com/tpope/vim-surround) -
|
|
||||||
quoting/parenthesizing made simple
|
|
||||||
* [Shebang](https://github.com/vim-scripts/Shebang) - Make executable by
|
|
||||||
setting the correct shebang and executable bit
|
|
||||||
* [Tagbar](http://majutsushi.github.com/tagbar/) - Displays tags in a window,
|
|
||||||
ordered by class etc.
|
|
||||||
* [NERD tree](https://github.com/scrooloose/nerdtree) - A tree explorer
|
|
||||||
* [nerdtree-git-plugin](https://github.com/Xuyuanp/nerdtree-git-plugin) - A
|
|
||||||
plugin of NERDTree showing git status
|
|
||||||
* [auto-pairs](https://github.com/jiangmiao/auto-pairs) - Insert or delete
|
|
||||||
brackets, parens, quotes in pair
|
|
||||||
* [po.vim](http://vim.sourceforge.net/scripts/script.php?script_id=695) -
|
|
||||||
Easier editing of GNU gettext PO files
|
|
||||||
* [MatchTagAlways](https://github.com/valloric/MatchTagAlways) - A Vim plugin
|
|
||||||
that always highlights the enclosing html/xml tags
|
|
||||||
* [vim-airline](https://github.com/bling/vim-airline) - Light weight status
|
|
||||||
line utility
|
|
||||||
* [tabular](https://github.com/godlygeek/tabular) - text filtering and
|
|
||||||
alignment
|
|
||||||
* [tcomment_vim](https://github.com/tomtom/tcomment_vim) - An extensible &
|
|
||||||
universal comment vim-plugin that also handles embedded filetypes
|
|
||||||
* [vim-unimpaired](https://github.com/tpope/vim-unimpaired) - pairs of handy
|
|
||||||
bracket mappings
|
|
||||||
* [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors) -
|
|
||||||
True Sublime Text style multiple selections for Vim
|
|
||||||
* [splitjoin.vim](https://github.com/AndrewRadev/splitjoin.vim) - A Vim plugin
|
|
||||||
that simplifies the transition between multiline and single-line code
|
|
||||||
* [vim-repeat](https://github.com/tpope/vim-repeat) - enable repeating supported plugin maps with "."
|
|
||||||
* [tsuquyomi](https://github.com/Quramy/tsuquyomi) - A Vim plugin for TypeScript
|
|
||||||
* [vim-highlightedyank](https://github.com/machakann/vim-highlightedyank) - Make the yanked region apparent!
|
|
||||||
|
|
||||||
|
|
||||||
Shortcuts and re-Mappings
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
| Key | Command |
|
|
||||||
| ---------------------- | ----------------------------------------------------------------- |
|
|
||||||
| ``jj`` | ``<Esc>`` in insert and command modes |
|
|
||||||
| ``<SPACE>`` | ``<Leader>`` |
|
|
||||||
| ``<Leader>v`` | Load `.vimrc` |
|
|
||||||
| ``<Leader>V`` | Activate changes to `.vimrc` (Make sure to save it before) |
|
|
||||||
| ``<F2>`` | Close current split (window) |
|
|
||||||
| ``<F3>`` | Toggle NERD tree |
|
|
||||||
| ``<F5>`` | Toggle Tagbar |
|
|
||||||
| ``<Leader>S`` | Remove trailing whitespace |
|
|
||||||
| ``<CTRL>hjkl`` | Window movement commands |
|
|
||||||
| ``<CTRL>arrow`` | Window movement commands |
|
|
||||||
| ``<Leader>d`` | Delete buffer, keep the split |
|
|
||||||
| ``-``, ``+`` | Resize horizontal splits |
|
|
||||||
| ``<ALT><`` ``<ALT>>`` | Resize vertical splits |
|
|
||||||
| ``<F9>`` | Toggle logical (RTL, e.g: Hebrew) editing |
|
|
||||||
| ``<F8>`` | Toggle visual (RTL, e.g: Hebrew) editing |
|
|
||||||
| ``g/`` | :grep!<Space> |
|
|
||||||
| ``g*`` | :grep! -w current_word |
|
|
||||||
| ``ga`` | :grepadd! (add results to the current search) |
|
|
||||||
| ``gr`` | :CtrlPBufTag (fuzzy tag search in current file) |
|
|
||||||
|
|
||||||
|
|
||||||
Virtualenv settings
|
|
||||||
-------------------
|
|
||||||
|
|
||||||
If you're running from virtualenv activated, make sure to point nvim and ale to
|
|
||||||
correct locations. By default, settings are:
|
|
||||||
|
|
||||||
let g:python3_host_prog = '/usr/bin/python'
|
|
||||||
let g:ale_python_flake8_executable = '/usr/bin/flake8'
|
|
||||||
|
|
||||||
If needed, override those settings to the locations on your machine.
|
|
@ -1,126 +0,0 @@
|
|||||||
# functions test
|
|
||||||
snippet /^test/ "Main function" r
|
|
||||||
func Test_${1:Func}(t *testing.T) {
|
|
||||||
${0:${VISUAL}}
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet tt "table-driven tests"
|
|
||||||
func Test_${1:Func}(t *testing.T) {
|
|
||||||
testCases := []struct {
|
|
||||||
name string
|
|
||||||
expected ${2}
|
|
||||||
${3}
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
name: "happy case",
|
|
||||||
expected: ${4},
|
|
||||||
${5},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, tc := range testCases {
|
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
|
||||||
actual := ${7}$1(${6:params})
|
|
||||||
|
|
||||||
if $8 {
|
|
||||||
t.Errorf("Expected %v, actual %v", tc.expected, actual)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet tte "table-driven tests with errors"
|
|
||||||
func Test_${1:Func}(t *testing.T) {
|
|
||||||
testCases := []struct {
|
|
||||||
name string
|
|
||||||
expected ${2}
|
|
||||||
${3}
|
|
||||||
wantErr bool
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
name: "happy case",
|
|
||||||
expected: ${4}
|
|
||||||
${5},
|
|
||||||
wantErr: false,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, tc := range testCases {
|
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
|
||||||
actual, err := ${7}$1(${6:params})
|
|
||||||
if (err != nil) != tc.wantErr {
|
|
||||||
t.Errorf("Error '%v' even if wantErr is %t", err, tc.wantErr)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if tc.wantErr == false && $8 {
|
|
||||||
t.Errorf("Expected %v, actual %v", tc.expected, actual)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet err "Basic error handling" b
|
|
||||||
if err != nil {
|
|
||||||
${1}
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet errr "Basic error handling return err" b
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
${1}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet errr, "Basic error handling return err with another return" b
|
|
||||||
if err != nil {
|
|
||||||
return ${1:nil}, err
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet errw "Return wrapped error" b
|
|
||||||
if err != nil {
|
|
||||||
return errors.Wrap(err, "${1}")
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet errwf "Basic error handling with wrapping format" b
|
|
||||||
if err != nil {
|
|
||||||
return errors.Wrapf(err, "${1}", ${2})
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet errab "Basic abort with error from Gin Context" b
|
|
||||||
if err != nil {
|
|
||||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet errabwf "Basic abort with error from Gin Context" b
|
|
||||||
if err != nil {
|
|
||||||
err = errors.Wrapf(err, "${1}", ${2})
|
|
||||||
c.AbortWithError(http.StatusInternalServerError, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet /^package/ "Package declaration" b
|
|
||||||
// Package $1 provides ...
|
|
||||||
package ${1:main}
|
|
||||||
$2
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet switcht "Switch type statement" b
|
|
||||||
switch ${1:expression}${1/(.+)/ /} := ${2:var}.(Type) {
|
|
||||||
case ${0:int}
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet e: "Variable declaration := with error" b
|
|
||||||
${1:name}, err:= ${0:value}
|
|
||||||
endsnippet
|
|
@ -1,11 +0,0 @@
|
|||||||
snippet faf "Fat arrow function (faf)" w
|
|
||||||
${1:function_name} = (${2:argument}) => {
|
|
||||||
${VISUAL}$0
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet afaf "Anonymous fat arrow function (faf)" w
|
|
||||||
(${1:argument}) => {
|
|
||||||
${VISUAL}$0
|
|
||||||
}
|
|
||||||
endsnippet
|
|
@ -1,154 +0,0 @@
|
|||||||
snippet ns "namespace declaration" b
|
|
||||||
namespace ${1:`!p
|
|
||||||
abspath = os.path.abspath(path)
|
|
||||||
m = re.search(r'[A-Z].+(?=/)', abspath)
|
|
||||||
if m:
|
|
||||||
snip.rv = m.group().replace('/', '\\')
|
|
||||||
`};
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet class "Class declaration template with strict mode" b
|
|
||||||
<?php declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace ${1:`!p
|
|
||||||
relpath = os.path.relpath(path)
|
|
||||||
m = re.search(r'[A-Z].+(?=/)', relpath)
|
|
||||||
if m:
|
|
||||||
snip.rv = m.group().replace('/', '\\')
|
|
||||||
`};
|
|
||||||
|
|
||||||
class ${1:`!p snip.rv=snip.basename`}
|
|
||||||
{
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet classa "Class declaration template with App/ begin namespace" b
|
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\\${1:`!p
|
|
||||||
relpath = os.path.relpath(path)
|
|
||||||
m = re.search(r'[A-Z].+(?=/)', relpath)
|
|
||||||
if m:
|
|
||||||
snip.rv = m.group().replace('/', '\\')
|
|
||||||
`};
|
|
||||||
|
|
||||||
class ${1:`!p snip.rv=snip.basename`}
|
|
||||||
{
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet interface "Interface declaration template" b
|
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace ${1:`!p
|
|
||||||
abspath = os.path.abspath(path)
|
|
||||||
m = re.search(r'[A-Z].+(?=/)', abspath)
|
|
||||||
if m:
|
|
||||||
snip.rv = m.group().replace('/', '\\')
|
|
||||||
`};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Interface ${1:`!p snip.rv=snip.basename`}
|
|
||||||
*/
|
|
||||||
interface $1
|
|
||||||
{
|
|
||||||
public function ${3:someFunction}();$4
|
|
||||||
}
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet pub "Public function" b
|
|
||||||
public function ${1:name}(${2:params})
|
|
||||||
{
|
|
||||||
$0${VISUAL}${3:return null;}
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet pro "Protected function" b
|
|
||||||
protected function ${1:name}()
|
|
||||||
{
|
|
||||||
${VISUAL}${5:return null;}
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet pri "Private function" b
|
|
||||||
private function ${1:name}()
|
|
||||||
{
|
|
||||||
${VISUAL}${5:return null;}
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet pubs "Public static function" b
|
|
||||||
public static function ${1:name}()
|
|
||||||
{
|
|
||||||
${VISUAL}${5:return null;}
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet pros "Protected static function" b
|
|
||||||
protected static function ${1:name}()
|
|
||||||
{
|
|
||||||
${VISUAL}${5:return null;}
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet pris "Private static function" b
|
|
||||||
private static function ${1:name}()
|
|
||||||
{
|
|
||||||
${VISUAL}${5:return null;}
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet fu "Function snip" b
|
|
||||||
function ${1:name}()
|
|
||||||
{
|
|
||||||
${VISUAL}${3:return null;}
|
|
||||||
}
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet new "New class instance" b
|
|
||||||
$${1:variableName} = new ${2:${1/\w+\s*/\u$0/}}($3);
|
|
||||||
$0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet ns "namespace declaration" b
|
|
||||||
namespace ${1:`!p
|
|
||||||
relpath = os.path.relpath(path)
|
|
||||||
m = re.search(r'[A-Z].+(?=/)', relpath)
|
|
||||||
if m:
|
|
||||||
snip.rv = m.group().replace('/', '\\')
|
|
||||||
`};
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet addS "doctrine add sql" b
|
|
||||||
$this->addSql("
|
|
||||||
$0
|
|
||||||
");
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet classst "Symlex test class declaration" b
|
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\\${1:`!p
|
|
||||||
relpath = os.path.relpath(path)
|
|
||||||
m = re.search(r'[A-Z].+(?=/)', relpath)
|
|
||||||
if m:
|
|
||||||
snip.rv = m.group().replace('/', '\\')
|
|
||||||
`};
|
|
||||||
|
|
||||||
use TestTools\TestCase\UnitTestCase;
|
|
||||||
|
|
||||||
class ${1:`!p snip.rv=snip.basename`} extends UnitTestCase
|
|
||||||
{
|
|
||||||
}
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet @var "var phpdoc" b
|
|
||||||
/** @var $0 */
|
|
||||||
endsnippet
|
|
16
vim/.vim/UltiSnips/tex.snippets
Normal file
16
vim/.vim/UltiSnips/tex.snippets
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
priority -10
|
||||||
|
|
||||||
|
extends tex
|
||||||
|
|
||||||
|
snippet "\\begin\{(\w+)\}" "multiline begin{} / end{}" rbA
|
||||||
|
\begin{`!p snip.rv = match.group(1)`}
|
||||||
|
$1
|
||||||
|
\end{`!p snip.rv = match.group(1)`}
|
||||||
|
$0
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
priority -20
|
||||||
|
|
||||||
|
snippet "(?<!^)\\begin\{(\w+)\}" "inline begin{} / end{}" riA
|
||||||
|
\begin{`!p snip.rv = match.group(1)`} $1 \end{`!p snip.rv = match.group(1)`} $0
|
||||||
|
endsnippet
|
@ -1,9 +0,0 @@
|
|||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
" Sections:
|
|
||||||
" -> Settings (01-settings)
|
|
||||||
" -> Theme (02-theme)
|
|
||||||
" -> Keymap (10-keymap-general, 11-keymap-rtl)
|
|
||||||
" -> File type specific (31-file-type.vim)
|
|
||||||
"
|
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# Install nvim
|
|
||||||
sudo apt remove vim-tiny
|
|
||||||
sudo apt install -y vim fzf silversearcher-ag tmux zathura latexmk git curl
|
|
||||||
|
|
||||||
# Install ctags (for tagbar)
|
|
||||||
echo '[*] App installing dependencies for tagbar (exuberant-ctags) ...'
|
|
||||||
sudo apt update
|
|
||||||
sudo apt install -y exuberant-ctags global
|
|
||||||
|
|
||||||
|
|
||||||
# Install vim-plug plugin manager
|
|
||||||
echo '[*] Downloading vim-plug, the best minimalistic vim plugin manager ...'
|
|
||||||
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
|
||||||
|
|
||||||
# (Optional but recommended) Install a nerd font for icons and a beautiful lightline bar (https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts)
|
|
||||||
echo "[*] Downloading patch font into ~/.local/share/fonts ..."
|
|
||||||
curl -fLo ~/.local/share/fonts/Iosevka\ Term\ Nerd\ Font\ Complete.ttf --create-dirs https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/Iosevka/Regular/complete/Iosevka%20Term%20Nerd%20Font%20Complete.ttf
|
|
||||||
|
|
||||||
# Enter vim and install plugins using a temporary init.vim, which avoids warnings about missing colorschemes, functions, etc
|
|
||||||
echo '[*] Running :PlugInstall within nvim ...'
|
|
||||||
vim +PlugInstall +qa
|
|
||||||
|
|
||||||
echo "[+] Done, welcome to \\033[1m\\033[92mVim\\033[0m! Try it by running: vim."
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
cat basic_header.vim rc.d/{01-settings,02-theme,10-keymap-general,11-keymap-rtl,31-file-type}.vim > basic.vim
|
|
||||||
sed -i 's/colorscheme minimalist/colorscheme desert/g' basic.vim
|
|
@ -2,15 +2,10 @@
|
|||||||
" vim-plug setup
|
" vim-plug setup
|
||||||
" ==================================================
|
" ==================================================
|
||||||
"
|
"
|
||||||
call plug#begin('~/.local/share/nvim/plugged')
|
call plug#begin('~/.local/share/vim/plugged')
|
||||||
|
|
||||||
" Color schemes and appearance
|
" Color schemes and appearance
|
||||||
|
Plug 'folke/tokyonight.nvim'
|
||||||
Plug 'frankier/neovim-colors-solarized-truecolor-only'
|
|
||||||
Plug 'chriskempson/base16-vim'
|
|
||||||
Plug 'drewtempelmeyer/palenight.vim'
|
|
||||||
"Plug 'kaicataldo/material.vim'
|
|
||||||
Plug 'dikiaap/minimalist'
|
|
||||||
|
|
||||||
" Appearance
|
" Appearance
|
||||||
Plug 'ryanoasis/vim-devicons'
|
Plug 'ryanoasis/vim-devicons'
|
||||||
@ -19,57 +14,30 @@ Plug 'junegunn/limelight.vim'
|
|||||||
Plug 'junegunn/goyo.vim'
|
Plug 'junegunn/goyo.vim'
|
||||||
Plug 'nathanaelkane/vim-indent-guides'
|
Plug 'nathanaelkane/vim-indent-guides'
|
||||||
Plug 'junegunn/vim-journal'
|
Plug 'junegunn/vim-journal'
|
||||||
Plug 'luochen1990/rainbow'
|
|
||||||
Plug 'bling/vim-bufferline'
|
Plug 'bling/vim-bufferline'
|
||||||
|
|
||||||
" easy way to rezise and exchange windows
|
|
||||||
Plug 'simeji/winresizer'
|
|
||||||
|
|
||||||
|
|
||||||
" General utilities
|
" General utilities
|
||||||
|
Plug 'simeji/winresizer' " easy way to rezise and exchange windows
|
||||||
Plug 'ctrlpvim/ctrlp.vim'
|
Plug 'ctrlpvim/ctrlp.vim'
|
||||||
Plug 'farmergreg/vim-lastplace'
|
|
||||||
Plug 'tpope/vim-sensible'
|
Plug 'tpope/vim-sensible'
|
||||||
Plug 'tpope/vim-surround'
|
Plug 'tpope/vim-surround'
|
||||||
Plug 'scrooloose/nerdtree', { 'on': ['NERDTreeToggle', 'NERDTreeFind']}
|
Plug 'scrooloose/nerdtree', { 'on': ['NERDTreeToggle', 'NERDTreeFind']}
|
||||||
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
|
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
|
||||||
Plug 'jistr/vim-nerdtree-tabs'
|
Plug 'jistr/vim-nerdtree-tabs'
|
||||||
Plug 'ervandew/supertab'
|
Plug 'ervandew/supertab'
|
||||||
Plug 'vim-scripts/DrawIt'
|
|
||||||
Plug 'terryma/vim-multiple-cursors'
|
|
||||||
Plug 'machakann/vim-highlightedyank'
|
Plug 'machakann/vim-highlightedyank'
|
||||||
Plug 'tpope/vim-repeat'
|
|
||||||
Plug 'junegunn/vim-easy-align'
|
|
||||||
Plug 'tpope/vim-abolish'
|
Plug 'tpope/vim-abolish'
|
||||||
Plug 'Yggdroot/indentLine'
|
Plug 'Yggdroot/indentLine'
|
||||||
Plug 'chrisbra/Colorizer'
|
Plug 'chrisbra/Colorizer'
|
||||||
Plug 'heavenshell/vim-pydocstring'
|
|
||||||
Plug 'vim-scripts/loremipsum'
|
|
||||||
Plug 'metakirby5/codi.vim'
|
|
||||||
Plug 'dkarter/bullets.vim'
|
|
||||||
Plug 'wesQ3/vim-windowswap'
|
|
||||||
Plug 'benmills/vimux'
|
|
||||||
Plug 'schickling/vim-bufonly'
|
|
||||||
Plug 'shougo/echodoc.vim'
|
|
||||||
Plug 'tpope/vim-sleuth'
|
|
||||||
"Plug 'tpope/vim-unimpaired'
|
|
||||||
Plug 'shougo/denite.nvim'
|
|
||||||
Plug 'wincent/loupe'
|
|
||||||
Plug 'jez/vim-superman' " Open man with vim using vman (need to be configured in zsh boot)
|
|
||||||
Plug 'blueyed/vim-diminactive' " Plug to dim not-focused windows
|
Plug 'blueyed/vim-diminactive' " Plug to dim not-focused windows
|
||||||
Plug 'lambdalisue/suda.vim' " Write file with sudo
|
Plug 'lambdalisue/suda.vim' " Write file with sudo
|
||||||
Plug 'junegunn/vim-peekaboo' " Display register values on " and @
|
Plug 'junegunn/vim-peekaboo' " Display register values on " and @
|
||||||
Plug 'yangmillstheory/vim-snipe' " replace f F t T to target easily the motion
|
"Plug 'yangmillstheory/vim-snipe' " replace f F t T to target easily the motion
|
||||||
|
Plug 'simnalamburt/vim-mundo' " undo tree
|
||||||
" undo tree
|
|
||||||
Plug 'simnalamburt/vim-mundo'
|
|
||||||
" close the current buffer
|
|
||||||
Plug 'moll/vim-bbye'
|
|
||||||
|
|
||||||
|
|
||||||
" Version control support
|
" Version control support
|
||||||
"
|
|
||||||
Plug 'tpope/vim-fugitive'
|
Plug 'tpope/vim-fugitive'
|
||||||
Plug 'mhinz/vim-signify'
|
Plug 'mhinz/vim-signify'
|
||||||
Plug 'Xuyuanp/nerdtree-git-plugin'
|
Plug 'Xuyuanp/nerdtree-git-plugin'
|
||||||
@ -82,8 +50,6 @@ Plug 'majutsushi/tagbar'
|
|||||||
Plug 'liuchengxu/vista.vim'
|
Plug 'liuchengxu/vista.vim'
|
||||||
Plug 'editorconfig/editorconfig-vim'
|
Plug 'editorconfig/editorconfig-vim'
|
||||||
Plug 'vim-scripts/Shebang'
|
Plug 'vim-scripts/Shebang'
|
||||||
Plug 'sirver/ultisnips'
|
|
||||||
Plug 'honza/vim-snippets'
|
|
||||||
Plug 'Valloric/MatchTagAlways'
|
Plug 'Valloric/MatchTagAlways'
|
||||||
Plug 'amiorin/vim-project'
|
Plug 'amiorin/vim-project'
|
||||||
Plug 'mhinz/vim-startify'
|
Plug 'mhinz/vim-startify'
|
||||||
@ -94,7 +60,6 @@ Plug 'ludovicchabant/vim-gutentags'
|
|||||||
Plug 'skywind3000/gutentags_plus'
|
Plug 'skywind3000/gutentags_plus'
|
||||||
Plug 'skywind3000/vim-preview'
|
Plug 'skywind3000/vim-preview'
|
||||||
|
|
||||||
|
|
||||||
" fzf - poweful fuzzy finder
|
" fzf - poweful fuzzy finder
|
||||||
" Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
|
" Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
|
||||||
" Plug 'junegunn/fzf.vim'
|
" Plug 'junegunn/fzf.vim'
|
||||||
@ -113,8 +78,8 @@ Plug 'hail2u/vim-css3-syntax'
|
|||||||
Plug 'cakebaker/scss-syntax.vim'
|
Plug 'cakebaker/scss-syntax.vim'
|
||||||
Plug 'vim-scripts/Fold-license'
|
Plug 'vim-scripts/Fold-license'
|
||||||
Plug 'neomake/neomake'
|
Plug 'neomake/neomake'
|
||||||
Plug 'joonty/vdebug'
|
|
||||||
Plug 'ap/vim-css-color' " display the hexadecimal colors - useful for css and color config
|
Plug 'ap/vim-css-color' " display the hexadecimal colors - useful for css and color config
|
||||||
|
Plug 'tpope/vim-sleuth'
|
||||||
|
|
||||||
" Polyglot
|
" Polyglot
|
||||||
Plug 'sheerun/vim-polyglot'
|
Plug 'sheerun/vim-polyglot'
|
||||||
@ -158,9 +123,7 @@ Plug 'vim-scripts/svg.vim'
|
|||||||
Plug 'voldikss/vim-mma'
|
Plug 'voldikss/vim-mma'
|
||||||
Plug 'wgwoods/vim-systemd-syntax'
|
Plug 'wgwoods/vim-systemd-syntax'
|
||||||
Plug 'wlangstroth/vim-racket'
|
Plug 'wlangstroth/vim-racket'
|
||||||
|
Plug 'mattn/emmet-vim' " emmet for html
|
||||||
" emmet for html
|
|
||||||
Plug 'mattn/emmet-vim'
|
|
||||||
|
|
||||||
" Markdown / Writting
|
" Markdown / Writting
|
||||||
Plug 'reedes/vim-pencil'
|
Plug 'reedes/vim-pencil'
|
||||||
@ -217,7 +180,14 @@ Plug 'mxw/vim-jsx'
|
|||||||
" Smart Autocomplete
|
" Smart Autocomplete
|
||||||
Plug 'w0rp/ale'
|
Plug 'w0rp/ale'
|
||||||
Plug 'kristijanhusak/deoplete-phpactor'
|
Plug 'kristijanhusak/deoplete-phpactor'
|
||||||
|
if has('nvim')
|
||||||
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
|
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
|
||||||
|
else
|
||||||
|
Plug 'Shougo/deoplete.nvim'
|
||||||
|
Plug 'roxma/nvim-yarp'
|
||||||
|
Plug 'roxma/vim-hug-neovim-rpc'
|
||||||
|
endif
|
||||||
|
let g:deoplete#enable_at_startup = 1
|
||||||
Plug 'zchee/deoplete-clang'
|
Plug 'zchee/deoplete-clang'
|
||||||
Plug 'wokalski/autocomplete-flow'
|
Plug 'wokalski/autocomplete-flow'
|
||||||
Plug 'sebastianmarkow/deoplete-rust'
|
Plug 'sebastianmarkow/deoplete-rust'
|
||||||
@ -229,6 +199,11 @@ Plug 'othree/xml.vim'
|
|||||||
Plug 'c9s/perlomni.vim'
|
Plug 'c9s/perlomni.vim'
|
||||||
Plug 'artur-shaik/vim-javacomplete2'
|
Plug 'artur-shaik/vim-javacomplete2'
|
||||||
|
|
||||||
|
" Snippets
|
||||||
|
Plug 'SirVer/ultisnips'
|
||||||
|
Plug 'honza/vim-snippets'
|
||||||
|
let g:UltiSnipsSnippetDirectories=[$HOME.'/.vim/UltiSnips']
|
||||||
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
" vim:set et sw=2:
|
" vim:set et sw=2:
|
||||||
|
@ -63,10 +63,10 @@ set tw=80
|
|||||||
" Turn persistent undo on means that you can undo
|
" Turn persistent undo on means that you can undo
|
||||||
" even when you close a buffer/VIM
|
" even when you close a buffer/VIM
|
||||||
" ==================================================
|
" ==================================================
|
||||||
set directory=~/.nvim_runtime/temp_dirs/swap/
|
set directory=~/.vim_runtime/temp_dirs/swap/
|
||||||
set backupdir=~/.nvim_runtime/temp_dirs/backup/
|
set backupdir=~/.vim_runtime/temp_dirs/backup/
|
||||||
try
|
try
|
||||||
set undodir=~/.nvim_runtime/temp_dirs/undodir
|
set undodir=~/.vim_runtime/temp_dirs/undodir
|
||||||
set undofile
|
set undofile
|
||||||
catch
|
catch
|
||||||
endtry
|
endtry
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
" ==================================================
|
" ==================================================
|
||||||
" Color scheme and fonts
|
" Color scheme and fonts
|
||||||
" ==================================================
|
" ==================================================
|
||||||
let g:rainbow_active = 1 "set to 0 if you want to enable it later via :RainbowToggle
|
|
||||||
let g:material_theme_style = 'palenight'
|
colorscheme tokyonight-storm
|
||||||
|
|
||||||
" disable the mouse - who needs a mouse??
|
" disable the mouse - who needs a mouse??
|
||||||
set mouse-=a
|
set mouse-=a
|
||||||
@ -38,12 +38,8 @@ if $COLORTERM == 'gnome-terminal'
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
set background=dark
|
set background=dark
|
||||||
"colorscheme material
|
|
||||||
set t_Co=256
|
set t_Co=256
|
||||||
colorscheme minimalist
|
|
||||||
hi Conceal guifg=#81A1C1 guibg=NONE ctermbg=NONE
|
hi Conceal guifg=#81A1C1 guibg=NONE ctermbg=NONE
|
||||||
let g:palenight_terminal_italics=1
|
|
||||||
let g:material_terminal_italics = 1
|
|
||||||
|
|
||||||
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
|
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
|
||||||
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
|
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
|
||||||
@ -66,7 +62,7 @@ highlight Comment gui=bold
|
|||||||
highlight Normal gui=NONE
|
highlight Normal gui=NONE
|
||||||
highlight NonText guibg=NONE
|
highlight NonText guibg=NONE
|
||||||
|
|
||||||
" Transparent Background (For i3 and compton)
|
" Transparent Background (For i3 and picom)
|
||||||
highlight Normal guibg=NONE ctermbg=NONE
|
highlight Normal guibg=NONE ctermbg=NONE
|
||||||
highlight LineNr guibg=NONE ctermbg=NONE
|
highlight LineNr guibg=NONE ctermbg=NONE
|
||||||
|
|
||||||
|
@ -22,11 +22,6 @@ nnoremap <expr> k v:count ? (v:count > 5 ? "m'" . v:count : '') . 'k' : 'gk'
|
|||||||
nnoremap n nzz
|
nnoremap n nzz
|
||||||
nnoremap N Nzz
|
nnoremap N Nzz
|
||||||
|
|
||||||
" Save session
|
|
||||||
exec 'nnoremap <Leader>ss :mksession! ~/.nvim_runtime/sessions/*.vim<C-D><BS><BS><BS><BS><BS>'
|
|
||||||
" Reload session
|
|
||||||
exec 'nnoremap <Leader>sl :so ~/.nvim_runtime/sessions/*.vim<C-D><BS><BS><BS><BS><BS>'
|
|
||||||
|
|
||||||
" quick make
|
" quick make
|
||||||
map <F6> :make<CR>
|
map <F6> :make<CR>
|
||||||
|
|
||||||
@ -34,13 +29,8 @@ map <F6> :make<CR>
|
|||||||
" http://tilvim.com/2014/03/18/a-better-paste.html
|
" http://tilvim.com/2014/03/18/a-better-paste.html
|
||||||
map <Leader>p :set paste<CR>o<esc>"+]p:set nopaste<cr>
|
map <Leader>p :set paste<CR>o<esc>"+]p:set nopaste<cr>
|
||||||
|
|
||||||
" Quickly save, quit, or save-and-quit
|
|
||||||
map <leader>w :w<CR>
|
|
||||||
map <leader>x :x<CR>
|
|
||||||
map <leader>q :q<CR>
|
|
||||||
|
|
||||||
" un-highlight when esc is pressed
|
" un-highlight when esc is pressed
|
||||||
map <silent><esc> :noh<cr>
|
"map <silent><esc> :noh<cr>
|
||||||
|
|
||||||
|
|
||||||
" Quickly toggle relative line numbers
|
" Quickly toggle relative line numbers
|
||||||
@ -62,8 +52,8 @@ cnoremap w!! execute ':w suda://%'
|
|||||||
|
|
||||||
" ,v loads .vimrc
|
" ,v loads .vimrc
|
||||||
" ,V reloads .vimrc -- activating changes (needs save)
|
" ,V reloads .vimrc -- activating changes (needs save)
|
||||||
map <leader>v :sp ~/.config/nvim/init.vim<CR><C-W>_
|
"map <leader>v :sp ~/.config/nvim/init.vim<CR><C-W>_
|
||||||
map <silent> <leader>V :source ~/.config/nvim/init.vim<CR>:filetype detect<CR>:exe ":echo 'vimrc reloaded'"<CR>
|
"map <silent> <leader>V :source ~/.config/nvim/init.vim<CR>:filetype detect<CR>:exe ":echo 'vimrc reloaded'"<CR>
|
||||||
|
|
||||||
" ==================================================
|
" ==================================================
|
||||||
" Window navigation
|
" Window navigation
|
||||||
@ -88,7 +78,7 @@ nnoremap <leader>wcc :cclose<cr>
|
|||||||
" windows creation
|
" windows creation
|
||||||
" create window on the bottom
|
" create window on the bottom
|
||||||
nnoremap <leader>wb <c-w>s
|
nnoremap <leader>wb <c-w>s
|
||||||
" create vertival window
|
" create vertical window
|
||||||
nnoremap <leader>wv <c-w>v
|
nnoremap <leader>wv <c-w>v
|
||||||
|
|
||||||
" " arrow keys resize windows
|
" " arrow keys resize windows
|
||||||
@ -106,7 +96,7 @@ nnoremap <leader>wv <c-w>v
|
|||||||
" ==================================================
|
" ==================================================
|
||||||
|
|
||||||
" Make these all work in insert mode
|
" Make these all work in insert mode
|
||||||
imap <C-W> <C-O><C-W>
|
"imap <C-W> <C-O><C-W>
|
||||||
|
|
||||||
" - and + to resize horizontal splits
|
" - and + to resize horizontal splits
|
||||||
map - <C-W>-
|
map - <C-W>-
|
||||||
@ -142,11 +132,6 @@ nnoremap tL :tabm<CR>
|
|||||||
noremap <S-l> gt
|
noremap <S-l> gt
|
||||||
noremap <S-h> gT
|
noremap <S-h> gT
|
||||||
|
|
||||||
" Let 'tl' toggle between this and the last accessed tab
|
|
||||||
let g:lasttab = 1
|
|
||||||
nmap <Leader>tl :exe "tabn ".g:lasttab<CR>
|
|
||||||
au TabLeave * let g:lasttab = tabpagenr()
|
|
||||||
|
|
||||||
" Opens a new tab with the current buffer's path
|
" Opens a new tab with the current buffer's path
|
||||||
" Super useful when editing files in the same directory
|
" Super useful when editing files in the same directory
|
||||||
map <leader>te :tabedit <c-r>=expand("%:p:h")<cr>/
|
map <leader>te :tabedit <c-r>=expand("%:p:h")<cr>/
|
||||||
@ -170,7 +155,6 @@ nmap <S-Tab> :bprevious<CR>
|
|||||||
" ==================================================
|
" ==================================================
|
||||||
" Clean all end of line whitespace with <Leader>S
|
" Clean all end of line whitespace with <Leader>S
|
||||||
" ==================================================
|
" ==================================================
|
||||||
":nnoremap <silent><leader>S :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR>
|
|
||||||
fun! TrimWhitespace()
|
fun! TrimWhitespace()
|
||||||
let l:save = winsaveview()
|
let l:save = winsaveview()
|
||||||
keeppatterns %s/\s\+$//e
|
keeppatterns %s/\s\+$//e
|
||||||
@ -178,51 +162,6 @@ fun! TrimWhitespace()
|
|||||||
endfun
|
endfun
|
||||||
:nnoremap <silent><leader>S :call TrimWhitespace()<CR>
|
:nnoremap <silent><leader>S :call TrimWhitespace()<CR>
|
||||||
|
|
||||||
" ==================================================
|
|
||||||
" Visual mode related
|
|
||||||
" ==================================================
|
|
||||||
" Visual mode pressing * or # searches for the current selection
|
|
||||||
" Super useful! From an idea by Michael Naumann
|
|
||||||
vnoremap <silent> * :<C-u>call VisualSelection('', '')<CR>/<C-R>=@/<CR><CR>
|
|
||||||
vnoremap <silent> # :<C-u>call VisualSelection('', '')<CR>?<C-R>=@/<CR><CR>
|
|
||||||
|
|
||||||
function! VisualSelection(direction, extra_filter) range
|
|
||||||
let l:saved_reg = @"
|
|
||||||
execute "normal! vgvy"
|
|
||||||
|
|
||||||
let l:pattern = escape(@", "\\/.*'$^~[]")
|
|
||||||
let l:pattern = substitute(l:pattern, "\n$", "", "")
|
|
||||||
|
|
||||||
if a:direction == 'gv'
|
|
||||||
call CmdLine("Ack '" . l:pattern . "' " )
|
|
||||||
elseif a:direction == 'replace'
|
|
||||||
call CmdLine("%s" . '/'. l:pattern . '/')
|
|
||||||
endif
|
|
||||||
|
|
||||||
let @/ = l:pattern
|
|
||||||
let @" = l:saved_reg
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
|
|
||||||
" ==================================================
|
|
||||||
" Editing mappings
|
|
||||||
" ==================================================
|
|
||||||
" Remap VIM 0 to first non-blank character
|
|
||||||
map 0 ^
|
|
||||||
|
|
||||||
" Move a line of text using ALT+[jk] or Command+[jk] on mac
|
|
||||||
nmap <M-j> mz:m+<cr>`z
|
|
||||||
nmap <M-k> mz:m-2<cr>`z
|
|
||||||
vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z
|
|
||||||
vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z
|
|
||||||
|
|
||||||
if has("mac") || has("macunix")
|
|
||||||
nmap <D-j> <M-j>
|
|
||||||
nmap <D-k> <M-k>
|
|
||||||
vmap <D-j> <M-j>
|
|
||||||
vmap <D-k> <M-k>
|
|
||||||
endif
|
|
||||||
|
|
||||||
" ==================================================
|
" ==================================================
|
||||||
" Spell checking
|
" Spell checking
|
||||||
" ==================================================
|
" ==================================================
|
||||||
@ -239,9 +178,6 @@ map <leader>s? z=
|
|||||||
" Other Configurations
|
" Other Configurations
|
||||||
" ==================================================
|
" ==================================================
|
||||||
|
|
||||||
" Remove the Windows ^M - when the encodings gets messed up
|
|
||||||
noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm
|
|
||||||
|
|
||||||
" Quickly open a buffer for scribble
|
" Quickly open a buffer for scribble
|
||||||
map <leader>q :e ~/buffer<cr>
|
map <leader>q :e ~/buffer<cr>
|
||||||
|
|
||||||
@ -251,25 +187,6 @@ map <leader>x :e ~/buffer.md<cr>
|
|||||||
" Toggle paste mode on and off
|
" Toggle paste mode on and off
|
||||||
map <leader>pp :setlocal paste!<cr>
|
map <leader>pp :setlocal paste!<cr>
|
||||||
|
|
||||||
noremap <C-p> :Denite buffer file_rec tag<CR>
|
|
||||||
|
|
||||||
xmap <leader>a gaip*
|
|
||||||
nmap <leader>t <C-w>s<C-w>j:terminal<CR>
|
|
||||||
nmap <leader>vt <C-w>v<C-w>l:terminal<CR>
|
|
||||||
nmap <leader>g :Goyo<CR>
|
|
||||||
nmap <leader>j :set filetype=journal<CR>
|
|
||||||
nmap <leader>l :Limelight!!<CR>
|
|
||||||
autocmd FileType python nmap <leader>x :0,$!~/.config/nvim/env/bin/python -m yapf<CR>
|
|
||||||
|
|
||||||
vmap <F2> !boxes -d stone
|
|
||||||
|
|
||||||
" surround by quotes - frequently use cases of vim-surround
|
|
||||||
map <leader>" ysiw"<cr>
|
|
||||||
map <leader>' ysiw'<cr>
|
|
||||||
|
|
||||||
" Act like D and C
|
|
||||||
nnoremap Y y$
|
|
||||||
|
|
||||||
" indent without kill the selection in vmode
|
" indent without kill the selection in vmode
|
||||||
vmap < <gv
|
vmap < <gv
|
||||||
vmap > >gv
|
vmap > >gv
|
||||||
@ -283,11 +200,6 @@ nnoremap <leader>[ :%s/<c-r><c-w>//g<left><left>
|
|||||||
" Change in next bracket
|
" Change in next bracket
|
||||||
nmap cinb cib
|
nmap cinb cib
|
||||||
|
|
||||||
" Visual mode pressing * or # searches for the current selection
|
|
||||||
" Super useful! From an idea by Michael Naumann
|
|
||||||
vnoremap <silent> * :<C-u>call general#VisualSelection('', '')<CR>/<C-R>=@/<CR><CR>
|
|
||||||
vnoremap <silent> # :<C-u>call general#VisualSelection('', '')<CR>?<C-R>=@/<CR><CR>
|
|
||||||
|
|
||||||
" delete character after cursor in insert mode
|
" delete character after cursor in insert mode
|
||||||
inoremap <C-d> <Del>
|
inoremap <C-d> <Del>
|
||||||
|
|
||||||
@ -317,10 +229,4 @@ let g:cm_matcher={'module': 'cm_matchers.abbrev_matcher', 'case': 'smartcase'}
|
|||||||
" Disable anoying ex mode
|
" Disable anoying ex mode
|
||||||
nnoremap Q <Nop>
|
nnoremap Q <Nop>
|
||||||
|
|
||||||
" Neovim :Terminal
|
|
||||||
tmap <Esc> <C-\><C-n>
|
|
||||||
tmap <C-w> <Esc><C-w>
|
|
||||||
autocmd BufWinEnter,WinEnter term://* startinsert
|
|
||||||
autocmd BufLeave term://* stopinsert
|
|
||||||
|
|
||||||
" vim:set et sw=2:
|
" vim:set et sw=2:
|
||||||
|
@ -4,14 +4,14 @@
|
|||||||
|
|
||||||
" toggle direction mapping
|
" toggle direction mapping
|
||||||
" this is useful for logical-order editing
|
" this is useful for logical-order editing
|
||||||
map <F9> :set invrl<CR>
|
"map <F9> :set invrl<CR>
|
||||||
" do it when in insert mode as well (and return to insert mode)
|
" do it when in insert mode as well (and return to insert mode)
|
||||||
imap <F9> <Esc>:set invrl<CR>a
|
"imap <F9> <Esc>:set invrl<CR>a
|
||||||
|
|
||||||
" toggle reverse insertion
|
" toggle reverse insertion
|
||||||
" this is useful for visual-order editing
|
" this is useful for visual-order editing
|
||||||
map <F8> :set invrevins<CR>
|
"map <F8> :set invrevins<CR>
|
||||||
" do it when in insert mode as well (and return to insert mode)
|
" do it when in insert mode as well (and return to insert mode)
|
||||||
imap <F8> <Esc>:set invrevins<CR>a
|
"imap <F8> <Esc>:set invrevins<CR>a
|
||||||
|
|
||||||
" vim:set et sw=2:
|
" vim:set et sw=2:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
" ==================================================
|
" ==================================================
|
||||||
" lightline
|
" lightline
|
||||||
" ==================================================
|
" ==================================================
|
||||||
let g:lightline = { 'colorscheme': 'material_vim' }
|
let g:lightline = { 'colorscheme': 'tokyonight' }
|
||||||
|
|
||||||
let g:lightline.active = {
|
let g:lightline.active = {
|
||||||
\ 'left': [ [ 'mode', 'paste' ], [ 'readonly', 'filename','gitbranch', 'modified', 'neospinner'] ],
|
\ 'left': [ [ 'mode', 'paste' ], [ 'readonly', 'filename','gitbranch', 'modified', 'neospinner'] ],
|
||||||
@ -11,6 +11,5 @@ let g:lightline.component = {
|
|||||||
\ 'charvaluehex': '0x%B',
|
\ 'charvaluehex': '0x%B',
|
||||||
\ 'readonly': '%{&readonly?"⭤":""}'
|
\ 'readonly': '%{&readonly?"⭤":""}'
|
||||||
\ }
|
\ }
|
||||||
let g:lightline.colorscheme = 'palenight'
|
|
||||||
|
|
||||||
" vim:set et sw=2:
|
" vim:set et sw=2:
|
||||||
|
@ -22,8 +22,5 @@ let g:vdebug_keymap = {
|
|||||||
let g:vdebug_options["path_maps"] = {
|
let g:vdebug_options["path_maps"] = {
|
||||||
\}
|
\}
|
||||||
|
|
||||||
" redefine the characters
|
|
||||||
autocmd VimEnter * sign define breakpt text= texthl=DbgBreakptSign linehl=DbgBreakptLine
|
|
||||||
autocmd VimEnter * sign define current text= texthl=DbgCurrentSign linehl=DbgCurrentLine
|
|
||||||
|
|
||||||
" vim:set et sw=2:
|
" vim:set et sw=2:
|
||||||
|
10
vim/.vim/rc.d/20-vimtex.vim
Normal file
10
vim/.vim/rc.d/20-vimtex.vim
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
let g:vimtex_view_method = 'zathura'
|
||||||
|
let g:vimtex_compiler_progname = '.venv/bin/nvr'
|
||||||
|
let g:tex_flavor = 'latex'
|
||||||
|
let g:ale_linters_ignore = {
|
||||||
|
\ 'tex': ['lacheck'],
|
||||||
|
\}
|
||||||
|
let g:ale_tex_chktex_options = "-I --nowarn 18"
|
||||||
|
augroup vimtex_config
|
||||||
|
autocmd User VimtexEventInitPost VimtexCompile
|
||||||
|
augroup END
|
Loading…
Reference in New Issue
Block a user