diff --git a/.gitignore b/.gitignore index a295fc2..719825e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ vim/bundle.user/* -vim/vimrc.user +vim/user.vim diff --git a/.gitmodules b/.gitmodules index 6c405c7..abd09f2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,15 +16,6 @@ [submodule "vim/bundle/vim-togglelist"] path = vim/bundle/vim-togglelist url = https://github.com/milkypostman/vim-togglelist.git -[submodule "vim/bundle/unite.vim"] - path = vim/bundle/unite.vim - url = https://github.com/Shougo/unite.vim.git -[submodule "vim/bundle/vimfiler.vim"] - path = vim/bundle/vimfiler.vim - url = https://github.com/Shougo/vimfiler.vim.git -[submodule "vim/bundle/tcomment_vim"] - path = vim/bundle/tcomment_vim - url = https://github.com/tomtom/tcomment_vim.git [submodule "vim/bundle/vim-fugitive"] path = vim/bundle/vim-fugitive url = https://github.com/tpope/vim-fugitive.git @@ -76,12 +67,6 @@ [submodule "vim/bundle/deoplete.nvim"] path = vim/bundle/deoplete.nvim url = https://github.com/Shougo/deoplete.nvim -[submodule "vim/bundle/nvim-yarp"] - path = vim/bundle/nvim-yarp - url = https://github.com/roxma/nvim-yarp -[submodule "vim/bundle/vim-hug-neovim-rpc"] - path = vim/bundle/vim-hug-neovim-rpc - url = https://github.com/roxma/vim-hug-neovim-rpc [submodule "vim/bundle/neco-syntax"] path = vim/bundle/neco-syntax url = https://github.com/Shougo/neco-syntax.git diff --git a/init.vim b/init.vim new file mode 100644 index 0000000..7b09750 --- /dev/null +++ b/init.vim @@ -0,0 +1,89 @@ +"=============================================================" +" " +" Darkcloud Neovim Config: vimrc " +" " +" By: Kevin MacMartin (prurigro@gmail.com) " +" Website: https://github.com/prurigro/darkcloud-nvimconfig " +" " +" License: MIT " +" " +"=============================================================" + +"darkcloud neovim config folder path: {{{ + "the location of darkcloud-nvimconfig (default is /etc/darkcloud-nvimconfig) + let g:darkcloudpath = get(g:, "darkcloudpath", "/etc/darkcloud-nvimconfig") +"}}} + +"LOAD DARKCLOUD CONFIG AND THEME FILES: {{{ + "Add Config Directory: (distro-agnostic system-wide) + let &runtimepath = printf('%s,%s/vim,%s/vim/after',&runtimepath,g:darkcloudpath,g:darkcloudpath) + + "Load Colours + if &term != "linux" + runtime colors/palette.vim + + "Load Colour Scheme: + colorscheme darkcloud + endif + + "Load Settings: + runtime config/settings.vim + + "Initialize Plugins: + let g:pathogen_disabled = get(g:, "pathogen_disabled", []) + + if has('python3') + "check for python-neovim + redir => python_neovim_check + silent python3 exec("import pkgutil\nneovim = pkgutil.find_loader('neovim')\nfound = neovim is not None\nprint(found)") + redir END + + if substitute(python_neovim_check, '^\n*\([^\n]*\)\n*$', '\1', '') == 'True' + let g:python_neovim = 1 + else + let g:python_neovim = 0 + endif + + "check for python-msgpack + redir => python_msgpack_check + silent python3 exec("import pkgutil\nmsgpack = pkgutil.find_loader('msgpack')\nfound = msgpack is not None\nprint(found)") + redir END + + if substitute(python_msgpack_check, '^\n*\([^\n]*\)\n*$', '\1', '') == 'True' + let g:python_msgpack = 1 + else + let g:python_msgpack = 0 + endif + else + "if python isn't available disable plugins that depend on it and set library variables to false + call add(g:pathogen_disabled, 'MatchTagAlways') + let g:python_neovim = 0 + let g:python_msgpack = 0 + endif + + "don't load vim-gutentags if ctags can't be found + if !executable('ctags') + call add(g:pathogen_disabled, 'vim-gutentags') + endif + + if !g:python_neovim || !g:python_msgpack + "don't load deoplete if either of its python dependencies are missing + call add(g:pathogen_disabled, 'deoplete.nvim') + call add(g:pathogen_disabled, 'neco-syntax') + endif + + "use pathogen to load plugins that haven't been disabled + runtime bundle/vim-pathogen/autoload/pathogen.vim + + "Load Keymappings: + runtime config/keyboard.vim + + "Load User Config: + runtime user.vim + + "Load Plugin Configuration: + runtime config/plugins.vim + + "Load After Config: + runtime config/after.vim +"}}} diff --git a/readme.md b/readme.md index e6b2ae3..75034cb 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,6 @@ -# darkcloud-vimconfig +# darkcloud-nvimconfig -A theme, config and collection of plugins for Vim. +A theme, config and collection of plugins for Neovim ## Requirements @@ -26,47 +26,34 @@ A theme, config and collection of plugins for Vim. * **Plugins**: A set of plugins have been included and configured to provide support for most normally-unsupported filetypes, and a set of features useful when using Vim as an editor. * **Custom Configuration**: A second vimrc and bundle folder are included that aren't maintained as part of the repo, making custom plugins and configuration easy to add. -![Darkcloud Vim Distribution Theme](https://i.imgur.com/oIqgie0.png) - -![Darkcloud Vimconfig Update Tool](https://i.imgur.com/AOXSL7S.png) - ## Installation -1. Clone the darkcloud-vimconfig repo and use the _update_ script to install the plugins: - * `git clone https://github.com/prurigro/darkcloud-vimconfig.git` - * `./darkcloud-vimconfig/update` (if you don't want colour output, run: `./darkcloud-vimconfig/update --no-colour` instead) - * **Note**: The _update_ script requires bash, but if it's not available you can enter the _darkcloud-vimconfig/_ folder and run: `git submodule update --init` to install the plugins manually, then create _vim/vimrc.user_ and remember to run: `:Helptags` once everything else is running. -2. If you don't know where vim expects to find your vimrc, start vim and run: `:version` to find the values "user vimrc file" (for a single-user install) and "system vimrc file" (for a system-wide install). T -3. Copy or symlink the vimrc file from `darkcloud-vimconfig/vimrc` to one of the locations vim expects to find it, based on whether you want a local or system-wide install, then choose one of the following: - * Edit the _g:darkcloudpath_ variable in the vimrc file itself, pointing it to the location you're keeping the _darkcloud-vimconfig_ repo folder. - * Create a file @ _~/.vim/darkcloud-path.vim_ and in it put the following: `let g:darkcloudpath="/etc/darkcloud-vimconfig"`, but replacing _"/etc/darkcloud-vimconfig"_ with the path to the _darkcloud-vimconfig_ repo folder. - * Place _darkcloud-vimconfig_ in the default location @ _/etc/darkcloud-vimconfig_. - * Create your own vimrc and have that set the _g:darkcloudpath_ variable before sourcing the included vimrc. +1. Clone the darkcloud-nvimconfig repo and run the `update` script. +2. By default the config expects darkcloud-nvimconfig to be installed @ `/etc/darkcloud-nvimconfig`, if you're installing it elsewhere you should add `let g:darkcloudpath = "/path/to/darkcloud-nvimconfig"` to your neovim init. +3. Add `source /path/to/darkcloud-nvimconfig/init.vim` to the neovim init that you want to use the config with ### Vimpager -You can configure your PAGER to use darkcloud-vimconfig using vimpager by adding the following to your bashrc (assuming the default path @ _"/etc/darkcloud-vimconfig"_): +You can configure your PAGER to use darkcloud-nvimconfig using vimpager by adding the following to your bashrc (assuming the default path @ _"/etc/darkcloud-nvimconfig"_): ``` -export PAGER=/etc/darkcloud-vimconfig/vim/bundle/vimpager/vimpager +export PAGER=/etc/darkcloud-nvimconfig/vim/bundle/vimpager/vimpager alias less="$PAGER" alias zless="$PAGER" ``` ## Configuration -* **Configure Variables**: The following variables can be added to _vim/vimrc.user_ and have their values set to the values you require: +* **Configure Variables**: The following variables can be added to `vim/user.vim` and have their values set to the values you require: * `g:autostartchecker`: **1** = Check syntax once an appropriate file is loaded | **0** = Check syntax only after syntax checking is toggled on (_default_: **0**) * `g:autostarttagbar`: **1** = Have the tagbar load automatically when a compatible format is run | **0** = The tagbar will stay hidden until triggered on demand with its toggle (_default_: **0**) * `g:disablecompletion`: **1** = Disable _deoplete_ autocompletion | **0** = Enable _deoplete _autocompletion_ if the requirements are met (_default_: **0**) * `g:disableautotags`: **1** = Prevent tags from being automatically generated and highlighted | **0** = Automatically generate and highlight tags (_default_: **0**) * `g:disablelinebreaks`: **1** = Override filetype plugins so linebreaks never occur | **0** = Linebreaks are disabled by default, but filetype plugins can override this setting (_default_: **0**) * `g:powerlinefonts`: **1** = Render the statusline using characters available with powerline-patched fonts | **0** = Render the statusbar with less attractive but more compatible characters available in all fonts (_default_: **0**) -* **Custom Settings**: Settings with priority over those set by darkcloud-vimconfig can be added to a file named _vimrc.user_, located in _darkcloud-vimconfig/vim/_ or any of the folders in the runtimepath. -* **Custom Plugins**: Pathogen compatible plugins can be cloned or extracted to "darkcloud-vimconfig/vim/bundle.user/", or a folder named "bundle" or "bundle.user" in any of the folders in the runtimepath. -* **File Associations**: To use the file manager in vim to run files with external programs, create "~/.vim/filetypes.vim" and on each line, write an association between a file extension and the program to launch files of that type that looks like: `call vimfiler#set_execute_file('mp4','xdg-open')`. -* **Update Script**: (requires: bash+git) Use this to update the project and submodules, as well as handle any required maintenance, generate docs from the pathogen plugins and create missing config scripts with preset values. -* **Generate System Tags**: (requires: bash+ctags) Generate a list of ctags for your system libraries in _/usr/include_ and _/usr/local/include_ as well as any folders passed as arguments by running the _gentags_ script. +* **Custom Settings**: Settings with priority over those set by darkcloud-nvimconfig can be added to `vim/user.vim` or any of the folders in the runtimepath. +* **Custom Plugins**: Pathogen compatible plugins can be cloned or extracted to `darkcloud-nvimconfig/vim/bundle.user/`, or a folder named `bundle` in any of the folders in the runtimepath. +* **Update Script**: (requires: bash+git) Use the `update` script to update the project and submodules, as well as handle any required maintenance, generate docs from the pathogen plugins and create missing config scripts with preset values. ## Mappings @@ -94,12 +81,11 @@ alias zless="$PAGER" #### Sidebars -| Binding | Mode | Action | -|------------|----------|-----------------------------------------------| -| F9 or \+} | ALL or N | Toggle git history for the current file | -| F10 or \+{ | ALL or N | Toggle the **tagbar** source code tag sidebar | -| F11 or \+\ | ALL or N | Toggle the location list for **ale** issues | -| F12 or \+[ | ALL or N | Toggle **vimfiler** file manager sidebar | +| Binding | Mode | Action | +|-----------------|------|-----------------------------------------------| +| F11 or Leader+[ | N | Toggle git history for the current file | +| F12 or Leader+] | N | Toggle the **tagbar** source code tag sidebar | +| Leader+Leader | N | Toggle the location list for **ale** issues | #### Toggles @@ -113,7 +99,7 @@ alias zless="$PAGER" | F4 | ALL | Toggle source code syntax checking | | | | | | \` | N | Toggle gutter (left bar with line numbers etc.) | -| Backslash+? | N | Toggle the **vim** reference manual | +| Leader+? | N | Toggle the **vim** reference manual | #### Spell Check @@ -136,25 +122,15 @@ alias zless="$PAGER" | Leader+T | N | Convert all spaces into tabs and continue session with tabs | | Leader+w | N | Remove all trailing whitespace | -#### GVim - -| Binding | Mode | Action | -|--------------|------|-----------------------| -| Backslash+F1 | ALL | Toggle the menubar | -| Backslash+F2 | ALL | Toggle the toolbar | -| Backslash+F3 | ALL | Toggle the scrollbars | - ### Complete Reference -For a complete list of mappings specific to **darkcloud-vimconfig**, check the list in the comments at the top of [vim/config/keyboard.vim](https://github.com/prurigro/darkcloud-vimconfig/blob/master/vim/config/keyboard.vim). +For a complete list of mappings specific to **darkcloud-nvimconfig**, check the list in the comments at the top of [vim/config/keyboard.vim](https://github.com/prurigro/darkcloud-nvimconfig/blob/master/vim/config/keyboard.vim). ## Plugins * [ale](https://github.com/w0rp/ale): Asynchronous Lint Engine * [deoplete.nvim](https://github.com/Shougo/deoplete.nvim): Dark powered asynchronous completion framework for neovim/Vim8 * [neco-syntax](https://github.com/Shougo/neco-syntax): Syntax source for neocomplete/deoplete/ncm - * [nvim-yarp](https://github.com/roxma/nvim-yarp): Yet Another Remote Plugin Framework for Neovim - * [vim-hug-neovim-rpc](https://github.com/roxma/vim-hug-neovim-rpc): A compatibility layer for neovim rpc client working on vim8 * [editorconfig-vim](https://github.com/editorconfig/editorconfig-vim): EditorConfig plugin for Vim that auto-configures certain settings when a .editorconfig file is present * [incsearch.vim](https://github.com/haya14busa/incsearch.vim): Improved incremental searching for Vim. * [lightline.vim](https://github.com/itchyny/lightline.vim): A light and configurable statusline/tabline for Vim. @@ -166,26 +142,23 @@ For a complete list of mappings specific to **darkcloud-vimconfig**, check the l * [tagbar](https://github.com/majutsushi/tagbar): Uses ctags to generate a sidebar of the tags for the current file. * [tcommand_vim](https://github.com/tomtom/tcommand_vim): Select commands, menu items etc. from a list. * [tlib_vim](https://github.com/tomtom/tlib_vim): Some utility functions for VIM. -* [tcomment_vim](https://github.com/tomtom/tcomment_vim): File-type sensible comments that can be easily toggled on and off for blocks of text. - * [unite.vim](https://github.com/Shougo/unite.vim): A library used by Vim Filer to help build its user interface. * [vim-fugitive](https://github.com/tpope/vim-fugitive): A wrapper integrating git into vim in such a way as to provide features neither of them could offer on their own. * [vim-gutentags](https://github.com/xolox/vim-easytags): A plugin that takes care of the much needed management of tags files in Vim. * [vim-move](https://github.com/matze/vim-move): Provides a few convenient ways to move selected text. * [vim-pathogen](https://github.com/tpope/vim-pathogen): A plugin to load other plugins while keeping them isolated in their own directory structure rather than all dumped together. -* [vim-polyglot-darkcloud](https://github.com/prurigro/vim-polyglot-darkcloud): The darkcloud-vimconfig fork of a meta-package that attempts to provide the best syntax plugins for each file type. +* [vim-polyglot-darkcloud](https://github.com/prurigro/vim-polyglot-darkcloud): The darkcloud-nvimconfig fork of a meta-package that attempts to provide the best syntax plugins for each file type. * [vim-signify](https://github.com/mhinz/vim-signify): When a version controlled file is changed, this displays a column showing where and how, and allows for navigation to and between differences. * [vim-surround](https://github.com/tpope/vim-surround): Provides functionality to exchange surrounding delimiters and xml-style tags with another, or simply remove them. * [vim-repeat](https://github.com/tpope/vim-repeat): A library used by vim-surround to allow its delimiter-switching functions to be repeated with the `.` command. * [vim-togglelist](https://github.com/milkypostman/vim-togglelist): A simple plugin for vim that allows you to bind a key to toggle the Location List and the Quickfix List. * [vim-trailing-whitespace](https://github.com/bronson/vim-trailing-whitespace): Highlights and allows for the easy removal of trailing whitespace in documents. * [vim-unimpaired](https://github.com/tpope/vim-unimpaired): Pairs of handy bracket mappings. -* [vimfiler.vim](https://github.com/Shougo/vimfiler.vim): A curses-style file manager for vim that runs on it's own or in a sidebar and can associate handlers for file types. * [vimpager](https://github.com/rkitover/vimpager): Pager using vim and less.vim ## Credits * By Kevin MacMartin: [GitHub Projects](https://github.com/prurigro?tab=repositories) | [Arch Linux AUR Packages](https://aur.archlinux.org/packages/?SeB=m&K=prurigro) -* The [vim-markdown](https://github.com/plasticboy/vim-markdown) plugin **TableFormat** command, used to format tables in markdown files, was pulled into [plugins.vim](https://github.com/prurigro/darkcloud-vimconfig/blob/master/vim/config/plugins.vim) from [ftplugin/mkd](https://github.com/plasticboy/vim-markdown/blob/master/ftplugin/mkd.vim). +* The [vim-markdown](https://github.com/plasticboy/vim-markdown) plugin **TableFormat** command, used to format tables in markdown files, was pulled into [plugins.vim](https://github.com/prurigro/darkcloud-nvimconfig/blob/master/vim/config/plugins.vim) from [ftplugin/mkd](https://github.com/plasticboy/vim-markdown/blob/master/ftplugin/mkd.vim). ## License diff --git a/update b/update index 9706c41..e3f9328 100755 --- a/update +++ b/update @@ -1,8 +1,8 @@ #!/usr/bin/env bash # -# Darkcloud Vim Config Update Tool -# https://github.com/prurigro/darkcloud-vimconfig +# Darkcloud Neovim Config Update Tool +# https://github.com/prurigro/darkcloud-nvimconfig # # Written by Kevin MacMartin (prurigro@gmail.com) # Released under the MIT license @@ -47,7 +47,7 @@ function error { # show_version: displays version information function show_version { - printf '%s\n' "$script_name: darkcloud-vimconfig update tool (version: $repo_version)" + printf '%s\n' "$script_name: darkcloud-nvimconfig update tool (version: $repo_version)" } # show_help: this function displays help output @@ -57,7 +57,7 @@ function show_help { printf '%s\n' 'OPTIONS' printf ' %s\t%s\n' '-v, --version' '| output version information and exit' printf ' %s\t%s\n\n' '-h, --help' '| display this help and exit' - printf '%s\n' 'Run with no arguments to update darkcloud-vimconfig' + printf '%s\n' 'Run with no arguments to update darkcloud-nvimconfig' } ### SETUP @@ -96,7 +96,7 @@ cd "$script_home" || exit } # display script title -printf '\n%s\n' "$cbg_black ~~~ DarkCloud Vimconfig Update Tool ~~~ $c_reset" +printf '\n%s\n' "$cbg_black ~~~ DarkCloud Neovim Config Update Tool ~~~ $c_reset" # create vim/bundle.user if it doesn't exist [[ -d 'vim/bundle.user' ]] || { @@ -111,10 +111,10 @@ printf '\n%s\n' "$cbg_black ~~~ DarkCloud Vimconfig Update Tool ~~~ $c_reset" fi } -# create vim/vimrc.user if it doesn't exist -[[ -e 'vim/vimrc.user' ]] || { +# create vim/user.vim if it doesn't exist +[[ -e 'vim/user.vim' ]] || { printf '\n%s' "$cbg_blue >> Creating user config file:$c_reset" - process_status="$(touch 'vim/vimrc.user' 2>&1)" + process_status="$(touch 'vim/user.vim' 2>&1)" if (( ! $? )); then { @@ -123,23 +123,22 @@ printf '\n%s\n' "$cbg_black ~~~ DarkCloud Vimconfig Update Tool ~~~ $c_reset" printf '%s\n%s\n\n' '"Disable Completion: (1:disable completion | *0:enable completion if requirements are met)' '"let g:disablecompletion = 0' printf '%s\n%s\n\n' '"Disable automatic tag generation and highlighting: (1:force disabled tag generation and highlighting | *0:enable automatic tag generation and highlighting)' '"let g:disableautotags = 0' printf '%s\n%s\n\n' '"Disable automatic linebreaking: (1:force disabled globally | *0:let the filetype decide)' '"let g:disablelinebreaks = 0' - printf '%s\n%s\n\n' '"Enable Powerline fonts: (1:expect powerline font | *0:expect regular font)' '"let g:powerlinefonts = 0 "(set powerline font for gvim and terminal when enabled)' - printf '%s\n%s\n' '"GVim font selection: (Escaping spaces and use powerline if appropriate)' '"set guifont=Monospace\ 12' - } >> vim/vimrc.user + printf '%s\n%s' '"Enable Powerline fonts: (1:expect powerline font | *0:expect regular font)' '"let g:powerlinefonts = 0 "(use powerline font glyphs when enabled)' + } >> vim/user.vim - if [[ -e 'vim/vimrc.user' ]]; then + if [[ -e 'vim/user.vim' ]]; then printf '%s\n' "$cfg_green_bold SUCCESS! $c_reset" else printf '%s\n' "$cfg_red_bold FAIL! $c_reset" fi else printf '%s\n' "$cfg_red_bold FAIL! $c_reset" - error "touch vim/vimrc.user" "User config couldn't be created" "$process_status" + error "touch vim/user.vim" "User config couldn't be created" "$process_status" fi } ### REPO UPDATE -printf '\n%s' "$cbg_blue >> Updating darkcloud-vimconfig:$c_reset" +printf '\n%s' "$cbg_blue >> Updating darkcloud-nvimconfig:$c_reset" process_status="$(git pull origin master 2>&1)" if (( ! $? )); then diff --git a/vim/bundle.user/README.md b/vim/bundle.user/README.md index ab09885..b95b538 100644 --- a/vim/bundle.user/README.md +++ b/vim/bundle.user/README.md @@ -1,6 +1,6 @@ -# Darkcloud Vim Theme, Custom Plugins Folder +# Custom Plugins Folder ## Instructions 1. Clone the repositories of pathogen-compatible plugins here to have them loaded when vim runs. -2. Configure these plugins using the vimrc.user file located in the directory below this after running the `update` script. +2. Configure these plugins using the `user.vim` file located in the directory below this after running the `update` script. diff --git a/vim/bundle/nvim-yarp b/vim/bundle/nvim-yarp deleted file mode 160000 index bb5f5e0..0000000 --- a/vim/bundle/nvim-yarp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bb5f5e038bfe119d3b777845a76b0b919b35ebc8 diff --git a/vim/bundle/tcomment_vim b/vim/bundle/tcomment_vim deleted file mode 160000 index 90eaf75..0000000 --- a/vim/bundle/tcomment_vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 90eaf759099bcd47aa0471f974109d7fd78e4eea diff --git a/vim/bundle/unite.vim b/vim/bundle/unite.vim deleted file mode 160000 index 0ccb3f7..0000000 --- a/vim/bundle/unite.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0ccb3f7988d61a9a86525374be97360bd20db6bc diff --git a/vim/bundle/vim-hug-neovim-rpc b/vim/bundle/vim-hug-neovim-rpc deleted file mode 160000 index 93ae387..0000000 --- a/vim/bundle/vim-hug-neovim-rpc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 93ae38792bc197c3bdffa2716ae493c67a5e7957 diff --git a/vim/bundle/vimfiler.vim b/vim/bundle/vimfiler.vim deleted file mode 160000 index 1c1d2b4..0000000 --- a/vim/bundle/vimfiler.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1c1d2b4f9e70c0b48bcf11bf51c482b8a2d776a8 diff --git a/vim/colors/darkcloud.vim b/vim/colors/darkcloud.vim index aca9da6..139b272 100644 --- a/vim/colors/darkcloud.vim +++ b/vim/colors/darkcloud.vim @@ -1,13 +1,13 @@ -"============================================================" -" " -" Darkcloud Vim Config: theme " -" " -" By: Kevin MacMartin (prurigro@gmail.com) " -" Website: https://github.com/prurigro/darkcloud-vimconfig " -" " -" License: MIT " -" " -"============================================================" +"=============================================================" +" " +" Darkcloud Neovim Config: theme " +" " +" By: Kevin MacMartin (prurigro@gmail.com) " +" Website: https://github.com/prurigro/darkcloud-nvimconfig " +" " +" License: MIT " +" " +"=============================================================" "remove all the colours before writing our own hi clear diff --git a/vim/config/after.vim b/vim/config/after.vim index f9e33de..9b5d194 100644 --- a/vim/config/after.vim +++ b/vim/config/after.vim @@ -1,13 +1,13 @@ -"============================================================" -" " -" Darkcloud Vim Config: settings to load after " -" " -" By: Kevin MacMartin (prurigro@gmail.com) " -" Website: https://github.com/prurigro/darkcloud-vimconfig " -" " -" License: MIT " -" " -"============================================================" +"=============================================================" +" " +" Darkcloud Neovim Config: settings to load after " +" " +" By: Kevin MacMartin (prurigro@gmail.com) " +" Website: https://github.com/prurigro/darkcloud-nvimconfig " +" " +" License: MIT " +" " +"=============================================================" "load the system version of matchit if another hasn't already been if !exists('g:loaded_matchit') && findfile('plugin/matchit.vim', &rtp) ==# '' @@ -67,8 +67,8 @@ autocmd FileChangedRO * nested set noreadonly autocmd VimEnter,FilterWritePre * if &diff|setlocal nofoldenable|endif autocmd VimEnter * if &diff|wincmd H|endif - "disable the whitespace plugin for vimfiler - autocmd BufEnter,FileType vimfiler,mail hi ExtraWhitespace ctermbg=NONE guibg=NONE + "disable the whitespace plugin for mail + autocmd BufEnter,FileType mail hi ExtraWhitespace ctermbg=NONE guibg=NONE "vimpager settings if exists('g:vimpager.enabled') diff --git a/vim/config/keyboard.vim b/vim/config/keyboard.vim index 630ad2b..30e0a58 100644 --- a/vim/config/keyboard.vim +++ b/vim/config/keyboard.vim @@ -1,13 +1,13 @@ -"============================================================" -" " -" Darkcloud Vim Config: keyboard settings " -" " -" By: Kevin MacMartin (prurigro@gmail.com) " -" Website: https://github.com/prurigro/darkcloud-vimconfig " -" " -" License: MIT " -" " -"============================================================" +"=============================================================" +" " +" Darkcloud Neovim Config: keyboard settings " +" " +" By: Kevin MacMartin (prurigro@gmail.com) " +" Website: https://github.com/prurigro/darkcloud-nvimconfig " +" " +" License: MIT " +" " +"=============================================================" " "Aliases: " :GitLog & :gitlog | (C) -> show a navigatable log of commit history @@ -54,8 +54,6 @@ " | (N) -> go to the next open tab " | (N) -> go to the previous open tab " | (N) -> open a new tab -" | (N) -> create a new tab with vimfiler -" | (N) -> create a new tab with a double pane vimfiler " " (split) " { | (N) -> rotate counter-clockwise @@ -91,19 +89,11 @@ " | (A) -> toggle external-paste mode " | (A) -> toggle syntax checking " -" | (A) -> toggle git commit history -" } | (N) -> toggle git commit history -" | (A) -> toggle the tagbar sidebar -" { | (N) -> toggle the tagbar sidebar -" | (A) -> toggle the location list +" | (N) -> toggle git commit history +" [ | (N) -> toggle git commit history +" | (N) -> toggle the tagbar sidebar +" ] | (N) -> toggle the tagbar sidebar " | (N) -> toggle the location list -" | (A) -> toggle vimfiler sidebar -" [ | (N) -> toggle vimfiler sidebar -" -" (gvim toggles) -" | (A) -> toggle the menubar -" | (A) -> toggle the toolbar -" | (A) -> toggle the scrollbars " " (spellcheck) " ?+ | (N) -> add the selected word to the local dictionary @@ -117,16 +107,16 @@ " p | (V) -> preserve the buffer pasting over selected text " Y | (N) -> copy to the end of the line " -" (delete/cut operations that don't replace the paste buffer) -" x | (N) -> delete the char(s) under and the cursor -" x | (V) -> delete the currently selected text -" X | (N) -> delete the char(s) before the cursor -" X | (V) -> delete the currently selected lines -" D | (N) -> delete from the cursor to EOL -" D | (V) -> delete the currently selected lines -" dw | (N) -> delete from the cursor to end of the word -" dd | (N) -> delete current line -" d | (V) -> delete selected text +" (delete/cut operations that don't replace the paste buffer) +" x | (N) -> delete the char(s) under and the cursor +" x | (V) -> delete the currently selected text +" X | (N) -> delete the char(s) before the cursor +" X | (V) -> delete the currently selected lines +" D | (N) -> delete from the cursor to EOL +" D | (V) -> delete the currently selected lines +" dw | (N) -> delete from the cursor to end of the word +" dd | (N) -> delete current line +" d | (V) -> delete selected text " " (fixing-and-formatting) " J | (N) -> split document into lines of tw or 80 @@ -219,16 +209,6 @@ " . | (N) -> replace diff in other pane with current pane " replace diff in current pane with other pane " replace diff in current pane with other pane -" -" (vimfiler) -" | (A) -> left click + left justify the cursor -" | (A) -> same as the left click -" | (A) -> same as the left click -" | (A) -> edit selected file -" | (A) -> map to l, which opens a directory -" | (A) -> map to h, which goes up one directory -" ' | (A) -> edit the selected file -" n | (A) -> start editing a new file "DISABLED DEFAULT MAPPING: UNSET SHORTCUTS {{{ "-unmapping tabbing from < and > for use with diff @@ -393,8 +373,6 @@ nnoremap ':tabnext' nnoremap ':tabprev' nnoremap ':tabnew' - nnoremap ':VimFiler -tab -project' - nnoremap ':VimFiler -tab -project -double' "} "SPLIT:{ @@ -466,45 +444,15 @@ inoremap ':call ToggleAle()' "view commit history and diffs - nnoremap ':vs:0Gclog:wincmd b' - xnoremap ':vs:0Gclog:wincmd b' - inoremap ':vs:0Gclog:wincmd b' - nnoremap } ':vs:0Gclog:wincmd b' + nnoremap ':vs:0Gclog:wincmd b' + nnoremap [ ':vs:0Gclog:wincmd b' "bindings to trigger the tagbar list of tags - nnoremap ':TagbarToggle:echo "tagbar toggled"' - xnoremap ':TagbarTogglegv' - inoremap ':TagbarToggle' - nnoremap { ':TagbarToggle:echo "tagbar toggled"' + nnoremap ':TagbarToggle:echo "tagbar toggled"' + nnoremap ] ':TagbarToggle:echo "tagbar toggled"' "toggle the location list - nnoremap ':call ToggleLocationList()' - xnoremap ':call ToggleLocationList()' - inoremap ':call ToggleLocationList()' nnoremap ':call ToggleLocationList()' - - "trigger vimfiler - nnoremap ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' - xnoremap ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' - inoremap ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' - nnoremap [ ':VimFiler -split -simple -toggle -no-quit -direction=topleft -winwidth=45' - "} - - "GVIM TOGGLES:{ - "toggle the menu - nnoremap ":if &go=~#'m'set go-=melseset go+=mendif:echo 'Menu bar toggled'" - vnoremap ":if &go=~#'m'set go-=melseset go+=mendifgv" - inoremap ":if &go=~#'m'set go-=melseset go+=mendif" - - "toggle the toolbar - nnoremap ":if &go=~#'T'set go-=Telseset go+=Tendif:echo 'Toolbar toggled'" - vnoremap ":if &go=~#'T'set go-=Telseset go+=Tendifgv" - inoremap ":if &go=~#'T'set go-=Telseset go+=Tendif" - - "toggle the scrollbars - nnoremap ":if &go=~#'l'set go-=lRbelseset go+=lRbendif:echo 'Scrollbars toggled'" - vnoremap ":if &go=~#'l'set go-=lRbelseset go+=lRbendifgv" - inoremap ":if &go=~#'l'set go-=lRbelseset go+=lRbendif" "} "SPELLCHECK:{ @@ -685,60 +633,51 @@ autocmd FilterWritePre * if &diff|nmap < do|endif autocmd FilterWritePre * if &diff|nmap , do|endif autocmd FilterWritePre * if &diff|cabbrev q! qall!|endif - - "vimfiler - autocmd FileType vimfiler map 0 - autocmd FileType vimfiler map - autocmd FileType vimfiler map - autocmd FileType vimfiler map <2-LeftMouse> (vimfiler_edit_file) - autocmd FileType vimfiler map l - autocmd FileType vimfiler map h - autocmd FileType vimfiler map ' e "}}} "MAPPINGS DISABLED FOR GIVEN FILETYPES: {{{ "remove incompatible toggles from specific file types - autocmd Filetype help,tagbar,qf,vimfiler noremap ` - autocmd Filetype help,tagbar,qf,vimfiler,diff noremap - autocmd Filetype help,tagbar,qf,vimfiler,diff noremap - autocmd Filetype help,tagbar,qf,vimfiler,diff noremap - autocmd Filetype help,tagbar,qf,vimfiler,diff noremap } - autocmd Filetype help,qf,vimfiler noremap - autocmd Filetype help,qf,vimfiler noremap - autocmd Filetype help,qf,vimfiler noremap - autocmd Filetype help,qf,vimfiler noremap { - autocmd Filetype help,tagbar,qf,vimfiler noremap - autocmd Filetype help,tagbar,qf,vimfiler noremap - autocmd Filetype help,tagbar,qf,vimfiler noremap ] - autocmd Filetype help,tagbar,qf,vimfiler noremap + autocmd Filetype help,tagbar,qf noremap ` + autocmd Filetype help,tagbar,qf,diff noremap + autocmd Filetype help,tagbar,qf,diff noremap + autocmd Filetype help,tagbar,qf,diff noremap + autocmd Filetype help,tagbar,qf,diff noremap } + autocmd Filetype help,qf noremap + autocmd Filetype help,qf noremap + autocmd Filetype help,qf noremap + autocmd Filetype help,qf noremap { + autocmd Filetype help,tagbar,qf noremap + autocmd Filetype help,tagbar,qf noremap + autocmd Filetype help,tagbar,qf noremap ] + autocmd Filetype help,tagbar,qf noremap autocmd Filetype help,tagbar,qf noremap autocmd Filetype help,tagbar,qf noremap autocmd Filetype help,tagbar,qf noremap autocmd Filetype help,tagbar,qf noremap [ "disable modifier keys with directions that would interfere with logic - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap - autocmd Filetype qf,vimfiler noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap + autocmd Filetype qf noremap "}}} diff --git a/vim/config/plugins.vim b/vim/config/plugins.vim index bd05691..dba304e 100644 --- a/vim/config/plugins.vim +++ b/vim/config/plugins.vim @@ -1,13 +1,13 @@ -"============================================================" -" " -" Darkcloud Vim Config: plugin settings " -" " -" By: Kevin MacMartin (prurigro@gmail.com) " -" Website: https://github.com/prurigro/darkcloud-vimconfig " -" " -" License: MIT " -" " -"============================================================" +"=============================================================" +" " +" Darkcloud Neovim Config: plugin settings " +" " +" By: Kevin MacMartin (prurigro@gmail.com) " +" Website: https://github.com/prurigro/darkcloud-nvimconfig " +" " +" License: MIT " +" " +"=============================================================" "use utf-8 encoding to load the script as it contains utf-8 characters scriptencoding utf-8 @@ -18,10 +18,6 @@ scriptencoding utf-8 call mkdir(glob("~/.vim/gutentags"),'p') endif - if !filereadable(glob("~/.vim/filetypes.vim")) - new|silent e ~/.vim/filetypes.vim|silent w|q - endif - "load plugins in vim/bundle/ and vim/bundle.user/ execute pathogen#infect('bundle/{}', 'bundle.user/{}') "}}} diff --git a/vim/config/plugins/lightline.vim b/vim/config/plugins/lightline.vim index ade191c..5f3c40b 100644 --- a/vim/config/plugins/lightline.vim +++ b/vim/config/plugins/lightline.vim @@ -1,6 +1,3 @@ -let g:unite_force_overwrite_statusline = 0 -let g:vimfiler_force_overwrite_statusline = 0 - function! LLModified() return &ft =~ 'help' ? '' : &modified ? '*' : &modifiable ? '' : '-' endfunction @@ -14,8 +11,6 @@ function! LLFilename() return \ fname == '__Tagbar__.1' ? g:lightline.fname : - \ &ft == 'vimfiler' ? vimfiler#get_status_string() : - \ &ft == 'unite' ? unite#get_status_string() : \ &ft == 'qf' ? '[Error/Location List]' : \ ('' != LLReadonly() ? LLReadonly() . ' ' : '') . \ ('' != fname ? fname : '[NEW]') . @@ -23,7 +18,7 @@ function! LLFilename() endfunction function! LLFugitive() - if expand('%:t') !~? 'Tagbar' && &ft !~? 'vimfiler' && exists('*FugitiveHead') + if expand('%:t') !~? 'Tagbar' && exists('*FugitiveHead') let mark = '' "edit here for cool mark let _ = FugitiveHead() return strlen(_) ? mark._ : '' @@ -48,8 +43,6 @@ function! LLMode() let fname = expand('%:t') return fname == '__Tagbar__' ? 'Tagbar' : - \ &ft == 'unite' ? 'Unite' : - \ &ft == 'vimfiler' ? 'VimFiler' : \ winwidth(0) > 60 ? lightline#mode() : '' endfunction diff --git a/vim/config/plugins/vimfiler.vim b/vim/config/plugins/vimfiler.vim deleted file mode 100644 index 41da4b2..0000000 --- a/vim/config/plugins/vimfiler.vim +++ /dev/null @@ -1,18 +0,0 @@ -let g:vimfiler_as_default_explorer = 1 -let g:vimfiler_safe_mode_by_default = 0 -let g:vimfiler_enable_auto_cd = 1 - -let g:vimfiler_tree_indentation = 2 -let g:vimfiler_explorer_columns = 'type:time' -let g:vimfiler_tree_closed_icon = '▸' "['▶', '▼'], ['▸', '▾'], ['▷', '◢'] -let g:vimfiler_tree_opened_icon = '▾' -let g:vimfiler_file_icon = '-' -let g:vimfiler_marked_file_icon = '+' - -"edit files by double clicking them, and justify the cursor on the left -autocmd FileType vimfiler setlocal nonumber nocursorcolumn - -"load the list of file extensions and handlers if it exists -if filereadable(glob("~/.vim/filetypes.vim")) - source ~/.vim/filetypes.vim -endif diff --git a/vim/config/settings.vim b/vim/config/settings.vim index fa402f5..28c61f1 100644 --- a/vim/config/settings.vim +++ b/vim/config/settings.vim @@ -1,23 +1,13 @@ -"============================================================" -" " -" Darkcloud Vim Config: main settings " -" " -" By: Kevin MacMartin (prurigro@gmail.com) " -" Website: https://github.com/prurigro/darkcloud-vimconfig " -" " -" License: MIT " -" " -"============================================================" - -"GVIM SETTINGS: {{{ - set guicursor+=a:blinkon0 "disable the blinking cursor - set guioptions=e "use the gui to render the list of open tabs - set guioptions+=g "make inactive menu items grey - set guioptions+=i "have the gui use the vim icon - set guioptions+=p "enable pointer callbacks for X11 (required by some WMs) - set guioptions+=h "prevent the cursor jumping to the longest line while scrolling - set winaltkeys=no "don't select the menu when pressing the alt-keys -"}}} +"=============================================================" +" " +" Darkcloud Neovim Config: main settings " +" " +" By: Kevin MacMartin (prurigro@gmail.com) " +" Website: https://github.com/prurigro/darkcloud-nvimconfig " +" " +" License: MIT " +" " +"=============================================================" "COMPATIBILITY SETTINGS: {{{ set nocompatible "disable vi-compatibility settings diff --git a/vimrc b/vimrc deleted file mode 100644 index a765edb..0000000 --- a/vimrc +++ /dev/null @@ -1,124 +0,0 @@ -"============================================================" -" " -" Darkcloud Vim Config: vimrc " -" " -" By: Kevin MacMartin (prurigro@gmail.com) " -" Website: https://github.com/prurigro/darkcloud-vimconfig " -" " -" License: MIT " -" " -"============================================================" - -"darkcloud vim config folder path: {{{ - "if you want to use darkcloud-vimconfig as a package without symlinking - "the vim folder or placing it @ /etc/darkcloud-vimconfig, create a file - "@ ~/.vim/darkcloud-path.vim and in it place the following, except with - "the path pointing to the cloned repo: - " - "let g:darkcloudpath = "/etc/darkcloud-vimconfig" - - if filereadable(glob("~/.vim/darkcloud-path.vim")) - source ~/.vim/darkcloud-path.vim - else - let g:darkcloudpath = "/etc/darkcloud-vimconfig" - endif -"}}} - -"LOAD DARKCLOUD CONFIG AND THEME FILES: {{{ - "Add Config Directory: (distro-agnostic system-wide) - let &runtimepath = printf('%s,%s/vim,%s/vim/after',&runtimepath,g:darkcloudpath,g:darkcloudpath) - - "Load Colours - if &term != "linux" - runtime colors/palette.vim - - "Load Colour Scheme: - colorscheme default "hack to fix vimrc colorschemes in some versions of vim - colorscheme darkcloud - endif - - "Load Settings: - runtime config/settings.vim - - "Initialize Plugins: - let g:pathogen_disabled = get(g:, "pathogen_disabled", []) - - if has('python3') - "configure pythonx and check for the python-neovim and python-msgpack libraries if python3 is found - if !has('nvim') - set pyxversion=3 - endif - - "check for python-neovim - redir => python_neovim_check - silent python3 exec("import pkgutil\nneovim = pkgutil.find_loader('neovim')\nfound = neovim is not None\nprint(found)") - redir END - - if substitute(python_neovim_check, '^\n*\([^\n]*\)\n*$', '\1', '') == 'True' - let g:python_neovim = 1 - else - let g:python_neovim = 0 - endif - - "check for python-msgpack - redir => python_msgpack_check - silent python3 exec("import pkgutil\nmsgpack = pkgutil.find_loader('msgpack')\nfound = msgpack is not None\nprint(found)") - redir END - - if substitute(python_msgpack_check, '^\n*\([^\n]*\)\n*$', '\1', '') == 'True' - let g:python_msgpack = 1 - else - let g:python_msgpack = 0 - endif - else - "if python isn't available disable plugins that depend on it and set library variables to false - call add(g:pathogen_disabled, 'MatchTagAlways') - let g:python_neovim = 0 - let g:python_msgpack = 0 - endif - - "don't load vim-gutentags if ctags can't be found - if !executable('ctags') - call add(g:pathogen_disabled, 'vim-gutentags') - endif - - if !g:python_neovim || !g:python_msgpack - "don't load deoplete if either of its python dependencies are missing - call add(g:pathogen_disabled, 'deoplete.nvim') - call add(g:pathogen_disabled, 'neco-syntax') - call add(g:pathogen_disabled, 'nvim-yarp') - call add(g:pathogen_disabled, 'vim-hug-neovim-rpc') - elseif has('nvim') - "don't load the neovim compatibility plugins required by deoplete if actually running neovim - call add(g:pathogen_disabled, 'nvim-yarp') - call add(g:pathogen_disabled, 'vim-hug-neovim-rpc') - endif - - "disable autocompletion logic when running in vimpager mode - if exists('g:vimpager.enabled') - call add(g:pathogen_disabled, 'deoplete.nvim') - call add(g:pathogen_disabled, 'neco-syntax') - call add(g:pathogen_disabled, 'nvim-yarp') - call add(g:pathogen_disabled, 'vim-hug-neovim-rpc') - endif - - "if neovim is being used we should disable plugins that aren't compatible or necessary - if has('nvim') - call add(g:pathogen_disabled, 'vim-fixkey') - endif - - "use pathogen to load plugins that haven't been disabled - runtime bundle/vim-pathogen/autoload/pathogen.vim - - "Load Keymappings: - runtime config/keyboard.vim - - "Load User Config: - runtime vimrc.user - - "Load Plugin Configuration: - runtime config/plugins.vim - - "Load After Config: - runtime config/after.vim -"}}}