diff --git a/.gitmodules b/.gitmodules index d0517d3e..d3303671 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,69 +16,3 @@ [submodule "shells/zsh/plugins/git-fuzzy"] path = shells/zsh/plugins/git-fuzzy url = https://github.com/bigH/git-fuzzy -[submodule "nvim/.config/nvim/pack/opt/gruvbox"] - path = nvim/.config/nvim/pack/bundle/opt/gruvbox - url = https://github.com/morhetz/gruvbox.git -[submodule "nvim/.config/nvim/pack/bundle/opt/fzf.vim"] - path = nvim/.config/nvim/pack/bundle/opt/fzf.vim - url = https://github.com/junegunn/fzf.vim -[submodule "nvim/.config/nvim/pack/bundle/opt/vim-tridactyl"] - path = nvim/.config/nvim/pack/bundle/opt/vim-tridactyl - url = https://github.com/tridactyl/vim-tridactyl -[submodule "nvim/.config/nvim/pack/bundle/opt/vim-less"] - path = nvim/.config/nvim/pack/bundle/opt/vim-less - url = https://github.com/groenewege/vim-less -[submodule "nvim/.config/nvim/pack/bundle/opt/vim-json"] - path = nvim/.config/nvim/pack/bundle/opt/vim-json - url = https://github.com/elzr/vim-json -[submodule "nvim/.config/nvim/pack/bundle/opt/vim-vinegar"] - path = nvim/.config/nvim/pack/bundle/opt/vim-vinegar - url = https://github.com/tpope/vim-vinegar -[submodule "nvim/.config/nvim/pack/bundle/opt/vim-surround"] - path = nvim/.config/nvim/pack/bundle/opt/vim-surround - url = https://github.com/tpope/vim-surround -[submodule "nvim/.config/nvim/pack/bundle/opt/vim-repeat"] - path = nvim/.config/nvim/pack/bundle/opt/vim-repeat - url = https://github.com/tpope/vim-repeat -[submodule "nvim/.config/nvim/pack/bundle/opt/nvim-lspconfig"] - path = nvim/.config/nvim/pack/bundle/opt/nvim-lspconfig - url = https://github.com/neovim/nvim-lspconfig/ -[submodule "nvim/.config/nvim/pack/bundle/opt/deoplete.nvim"] - path = nvim/.config/nvim/pack/bundle/opt/deoplete.nvim - url = https://github.com/Shougo/deoplete.nvim -[submodule "nvim/.config/nvim/pack/bundle/opt/deoplete-notmuch"] - path = nvim/.config/nvim/pack/bundle/opt/deoplete-notmuch - url = https://github.com/paretje/deoplete-notmuch -[submodule "nvim/.config/nvim/pack/bundle/opt/deoplete-lsp"] - path = nvim/.config/nvim/pack/bundle/opt/deoplete-lsp - url = https://github.com/Shougo/deoplete-lsp -[submodule "nvim/.config/nvim/pack/bundle/opt/vim-fugitive"] - path = nvim/.config/nvim/pack/bundle/opt/vim-fugitive - url = https://github.com/tpope/vim-fugitive -[submodule "nvim/.config/nvim/pack/bundle/opt/AnsiEsc.vim"] - path = nvim/.config/nvim/pack/bundle/opt/AnsiEsc.vim - url = https://github.com/vim-scripts/AnsiEsc.vim -[submodule "nvim/.config/nvim/pack/bundle/opt/firenvim"] - path = nvim/.config/nvim/pack/bundle/opt/firenvim - url = https://github.com/glacambre/firenvim -[submodule "nvim/.config/nvim/pack/bundle/opt/ultisnips"] - path = nvim/.config/nvim/pack/bundle/opt/ultisnips - url = https://github.com/SirVer/ultisnips -[submodule "nvim/.config/nvim/pack/bundle/opt/vim-snippets"] - path = nvim/.config/nvim/pack/bundle/opt/vim-snippets - url = https://github.com/honza/vim-snippets -[submodule "nvim/.config/nvim/pack/bundle/opt/lexima.vim"] - path = nvim/.config/nvim/pack/bundle/opt/lexima.vim - url = https://github.com/cohama/lexima.vim -[submodule "nvim/.config/nvim/pack/bundle/opt/nvim-treesitter"] - path = nvim/.config/nvim/pack/bundle/opt/nvim-treesitter - url = https://github.com/nvim-treesitter/nvim-treesitter -[submodule "nvim/.config/nvim/pack/bundle/opt/vim-projectionist"] - path = nvim/.config/nvim/pack/bundle/opt/vim-projectionist - url = https://github.com/tpope/vim-projectionist -[submodule "nvim/.config/nvim/pack/bundle/opt/gruvbox-baby"] - path = nvim/.config/nvim/pack/bundle/opt/gruvbox-baby - url = https://github.com/luisiacc/gruvbox-baby -[submodule "nvim/.config/nvim/pack/bundle/opt/vim-openscad"] - path = nvim/.config/nvim/pack/bundle/opt/vim-openscad - url = https://github.com/sirtaj/vim-openscad diff --git a/nvim/.config/nvim/after/plugin/lsp.vim b/nvim/.config/nvim/after.old/plugin/lsp.vim similarity index 90% rename from nvim/.config/nvim/after/plugin/lsp.vim rename to nvim/.config/nvim/after.old/plugin/lsp.vim index 8c68500c..027bd760 100644 --- a/nvim/.config/nvim/after/plugin/lsp.vim +++ b/nvim/.config/nvim/after.old/plugin/lsp.vim @@ -9,11 +9,12 @@ lua < + vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' + + -- Buffer local mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local opts = { buffer = ev.buf } + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) + vim.keymap.set('n', '', vim.lsp.buf.signature_help, opts) + vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, opts) + vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, opts) + vim.keymap.set('n', 'wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, opts) + vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, opts) + vim.keymap.set('n', 'rn', vim.lsp.buf.rename, opts) + vim.keymap.set({ 'n', 'v' }, 'ca', vim.lsp.buf.code_action, opts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) + --vim.keymap.set('n', 'f', function() + -- vim.lsp.buf.format { async = true } + --end, opts) + end, + }) + + end, +--},{ +-- "L3MON4D3/LuaSnip", +-- dependencies={ +-- "saadparwaiz1/cmp_luasnip", +-- "rafamadriz/friendly-snippets" +-- }, +-- config=function () +-- require("luasnip.loaders.from_vscode").lazy_load() +-- end, +-- keys = { +-- { "", function () +-- return require("luasnip").jumpable(1) and "luasnip-jump-next" or "" +-- end, expr = true, silent = true, mode = "i" +-- }, +-- { "", function() require("luasnip").jump(1) end, mode = "s" }, +-- { "", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, +-- } +},{ + "hrsh7th/nvim-cmp", + dependencies={ + "neovim/nvim-lspconfig", + --"L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + }, + opts=function() + local cmp = require("cmp") + local capabilities = require('cmp_nvim_lsp').default_capabilities() + + return { + snippet = { + -- REQUIRED - you must specify a snippet engine + expand = function(args) + --vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + -- require('snippy').expand_snippet(args.body) -- For `snippy` users. + -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. + end, + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "path" }, + { name = "buffer" } + }) + } + end +}} + + + diff --git a/nvim/.config/nvim/lua/plugins/fzf.lua b/nvim/.config/nvim/lua/plugins/fzf.lua new file mode 100644 index 00000000..96b741e5 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/fzf.lua @@ -0,0 +1,25 @@ +return{ { + "junegunn/fzf.vim", + dependencies="junegunn/fzf", + init = function( lazy ) + vim.g.fzf_command_prefix="Fzf" + end, + config = function( lazy, opts) + vim.g.fzf_layout = { + window = { + width= 0.9, + height=0.8 + } + } + + vim.keymap.set('n', 'f', ':FzfFiles', {desc="Fuzzy find files"}) + vim.keymap.set('n', 'b', ':FzfBuffers', {desc="Fuzzy find buffers"}) + vim.keymap.set('n', 'h', ':FzfHelptags', {desc="Fuzzy find help tags"}) + vim.keymap.set('n', '/', ':FzfRg ', {desc="Fuzzy find RG"}) + vim.keymap.set('n', '\\/', ':FzfRg ^# ', {desc="Fuzzy find headings"}) + + end +} } + + + diff --git a/nvim/.config/nvim/lua/plugins/gruvbox.lua b/nvim/.config/nvim/lua/plugins/gruvbox.lua new file mode 100644 index 00000000..0dec88cd --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/gruvbox.lua @@ -0,0 +1,21 @@ +return {{ + "ellisonleao/gruvbox.nvim", + lazy = false, + priority=1000, + opts={ + terminal_colors = true, + italic = { + strings = false, + emphasis = false, + comments = true, + operators = false, + folds = true, + } + } +}} + +-- Colourscheme settings +-- vim.g.gruvbox_italic=1 +-- vim.g.gruvbox_hls_cursor="red" +-- vim.opt.termguicolors=true +--vim.cmd('colorscheme gruvbox') diff --git a/nvim/.config/nvim/lua/plugins/init.lua b/nvim/.config/nvim/lua/plugins/init.lua new file mode 100644 index 00000000..c7017034 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/init.lua @@ -0,0 +1,3 @@ +return { { + "tpope/vim-fugitive" +} } diff --git a/nvim/.config/nvim/lua/plugins/surround.lua b/nvim/.config/nvim/lua/plugins/surround.lua new file mode 100644 index 00000000..f7e46723 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/surround.lua @@ -0,0 +1,4 @@ +return {{ + "kylechui/nvim-surround", + opts={} +}} diff --git a/nvim/.config/nvim/lua/plugins/treesitter.lua b/nvim/.config/nvim/lua/plugins/treesitter.lua new file mode 100644 index 00000000..38f79fb7 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,14 @@ +return {{ + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + opts = { + ensure_installed = "all", + highlight = { + enable = true + }, + indent = { + enable = true + } + } + +}} diff --git a/nvim/.config/nvim/lua/plugins/ultimate-autopair.lua b/nvim/.config/nvim/lua/plugins/ultimate-autopair.lua new file mode 100644 index 00000000..9b1fd434 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/ultimate-autopair.lua @@ -0,0 +1,11 @@ +return {{ + 'altermo/ultimate-autopair.nvim', + event={'InsertEnter','CmdlineEnter'}, + branch='v0.6', --recomended as each new version will have breaking changes + opts={ + tabout={ + enable=true + } + }, +}} + diff --git a/nvim/.config/nvim/pack/bundle/opt/AnsiEsc.vim b/nvim/.config/nvim/pack/bundle/opt/AnsiEsc.vim deleted file mode 160000 index d2bb7878..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/AnsiEsc.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d2bb7878622e4c16203acf1c92a0f4bc7ac58003 diff --git a/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/.flake8 b/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/.flake8 deleted file mode 100644 index 495e50bb..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/.flake8 +++ /dev/null @@ -1,4 +0,0 @@ -[flake8] -exclude = .git,__pycache__,autoload,doc -max-complexity = 10 -max-line-length = 100 diff --git a/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/LICENSE b/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/LICENSE deleted file mode 100644 index 5a37f2de..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Filip Szymański - -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. diff --git a/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/README.md b/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/README.md deleted file mode 100644 index e518b6d0..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# deoplete-abook - -`Deoplete-abook` offers asynchronous completion of email addresses in [Mutt](http://www.mutt.org/) using [abook](http://abook.sourceforge.net/) contacts stored in a plain text database. -Inspired by [Greg Hurrell's](https://github.com/wincent) Vim screencast [#58](https://www.youtube.com/watch?v=BNnSjJOpXDk). - -## Installation - -To install `deoplete-abook`, use your favorite [Neovim](https://neovim.io/) plugin manager. - -#### Using [vim-plug](https://github.com/junegunn/vim-plug) - -```vim -Plug 'Shougo/deoplete.nvim', {'do': ':UpdateRemotePlugins'} -Plug 'fszymanski/deoplete-abook' -``` - -## Documentation - -For more information, see `:help deoplete_abook.txt`. diff --git a/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/autoload/health/deoplete_abook.vim b/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/autoload/health/deoplete_abook.vim deleted file mode 100644 index 0fe8579d..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/autoload/health/deoplete_abook.vim +++ /dev/null @@ -1,35 +0,0 @@ -scriptencoding utf-8 - -" Copyright (c) 2017 Filip Szymański. All rights reserved. -" Use of this source code is governed by an MIT license that can be -" found in the LICENSE file. - -function! s:check_deoplete() abort - if !empty(globpath(&runtimepath, 'plugin/deoplete.vim')) - call health#report_ok('Deoplete plugin is installed') - else - call health#report_error('Deoplete plugin is not installed', [ - \ 'The deoplete plugin can be found here: ' . - \ 'https://github.com/Shougo/deoplete.nvim' - \ ]) - endif -endfunction - -function! s:check_addressbook() abort - let datafile = get(g:, 'deoplete#sources#abook#datafile', - \ expand('~/.abook/addressbook')) - if filereadable(datafile) - call health#report_ok('Addressbook file was found: ' . datafile) - else - call health#report_error('Addressbook file was not found', - \ ['help: deoplete_abook.txt']) - endif -endfunction - -function! health#deoplete_abook#check() abort - call health#report_start('Dependencies') - call s:check_deoplete() - call s:check_addressbook() -endfunction - -" vim: ts=2 et sw=2 diff --git a/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/doc/deoplete_abook.txt b/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/doc/deoplete_abook.txt deleted file mode 100644 index 1ad6bda4..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/doc/deoplete_abook.txt +++ /dev/null @@ -1,61 +0,0 @@ -*deoplete_abook.txt* Deoplete source for abook contacts - -Author: Filip Szymański - -============================================================================== -CONTENTS *deoplete-abook-contents* - - 1. Introduction |deoplete-abook-introduction| - 2. Configuration |deoplete-abook-configuration| - 3. License |deoplete-abook-license| - 4. Bugs |deoplete-abook-bugs| - 5. Contributing |deoplete-abook-contributing| - -============================================================================== -INTRODUCTION *deoplete-abook-introduction* - -This deoplete[1] source offers asynchronous completion of email addresses -in Mutt[2] using abook[3] contacts stored in a plain text database. - -Note: Inspired by Greg Hurrell's[4] Vim screencast #58[5]. - -============================================================================== -CONFIGURATION *deoplete-abook-configuration* - - *g:deoplete#sources#abook#datafile* -Set this option to use an alternative addressbook file. -> - let g:deoplete#sources#abook#datafile = expand('~/path/to/addressbook') -< -Default: '~/.abook/addressbook' -Type: string - -============================================================================== -LICENSE *deoplete-abook-license* - -MIT - -============================================================================== -BUGS *deoplete-abook-bugs* - -If you find a bug please create an issue on GitHub. - -https://github.com/fszymanski/deoplete-abook/issues - -============================================================================== -CONTRIBUTING *deoplete-abook-contributing* - -Think you can make this plugin better? Awesome. Fork it on GitHub and create -a pull request. - -https://github.com/fszymanski/deoplete-abook - -============================================================================== - -[1] https://github.com/Shougo/deoplete.nvim -[2] http://www.mutt.org/ -[3] http://abook.sourceforge.net/ -[4] https://github.com/wincent -[5] https://www.youtube.com/watch?v=BNnSjJOpXDk - - vim: tw=78 ts=8 ft=help norl diff --git a/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/rplugin/python3/deoplete/sources/__pycache__/abook.cpython-310.pyc b/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/rplugin/python3/deoplete/sources/__pycache__/abook.cpython-310.pyc deleted file mode 100644 index f5d66f62..00000000 Binary files a/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/rplugin/python3/deoplete/sources/__pycache__/abook.cpython-310.pyc and /dev/null differ diff --git a/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/rplugin/python3/deoplete/sources/__pycache__/abook.cpython-38.pyc b/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/rplugin/python3/deoplete/sources/__pycache__/abook.cpython-38.pyc deleted file mode 100644 index 14ef25e8..00000000 Binary files a/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/rplugin/python3/deoplete/sources/__pycache__/abook.cpython-38.pyc and /dev/null differ diff --git a/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/rplugin/python3/deoplete/sources/__pycache__/abook.cpython-39.pyc b/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/rplugin/python3/deoplete/sources/__pycache__/abook.cpython-39.pyc deleted file mode 100644 index b71e5dbb..00000000 Binary files a/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/rplugin/python3/deoplete/sources/__pycache__/abook.cpython-39.pyc and /dev/null differ diff --git a/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/rplugin/python3/deoplete/sources/abook.py b/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/rplugin/python3/deoplete/sources/abook.py deleted file mode 100644 index 491ad5de..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/deoplete-abook/rplugin/python3/deoplete/sources/abook.py +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright (c) 2017 Filip Szymański. All rights reserved. -# Use of this source code is governed by an MIT license that can be -# found in the LICENSE file. - -import configparser -import os.path -import re - -from .base import Base # pylint: disable=E0401 - - -# pylint: disable=W0201,W0613 -class Source(Base): - COLON_PATTERN = re.compile(r':\s?') - COMMA_PATTERN = re.compile(r'.+,\s?') - HEADER_PATTERN = re.compile(r'^(Bcc|Cc|From|Reply-To|To):(\s?|.+,\s?)') - - def __init__(self, vim): - super().__init__(vim) - - self.__cache = [] - - self.filetypes = ['mail'] - self.mark = '[abook]' - self.matchers = ['matcher_length', 'matcher_full_fuzzy'] - self.min_pattern_length = 0 - self.name = 'abook' - - def on_init(self, context): - self.__datafile = context['vars'].get('deoplete#sources#abook#datafile', - os.path.expanduser('~/.abook/addressbook')) - if not os.path.isfile(self.__datafile): - self.vim.err_write('[deoplete-abook] No such file: {0}\n'.format(self.__datafile)) - - def on_event(self, context): - self.__make_cache() - - def gather_candidates(self, context): - if self.HEADER_PATTERN.search(context['input']) is not None: - if not self.__cache: - self.__make_cache() - - return self.__cache - - def get_complete_position(self, context): - colon = self.COLON_PATTERN.search(context['input']) - comma = self.COMMA_PATTERN.search(context['input']) - return max(colon.end() if colon is not None else -1, - comma.end() if comma is not None else -1) - - def __make_cache(self): - addressbook = configparser.ConfigParser() - addressbook.read(self.__datafile) - for section in addressbook.sections(): - emails = addressbook.get(section, 'email', fallback=None) - if emails is not None: - name = addressbook.get(section, 'name', fallback=None) - for email in emails.split(','): - if name is not None: - email = '"{0}" <{1}>'.format(name, email) - - self.__cache.append({'word': email}) - -# vim: ts=4 et sw=4 diff --git a/nvim/.config/nvim/pack/bundle/opt/deoplete-lsp b/nvim/.config/nvim/pack/bundle/opt/deoplete-lsp deleted file mode 160000 index f3d1f14f..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/deoplete-lsp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f3d1f14fa8a8cf882be39605fb037ee982c3f37c diff --git a/nvim/.config/nvim/pack/bundle/opt/deoplete-notmuch b/nvim/.config/nvim/pack/bundle/opt/deoplete-notmuch deleted file mode 160000 index d582895f..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/deoplete-notmuch +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d582895f0e4e7bcc40e43ac2cb357afecfe5eda8 diff --git a/nvim/.config/nvim/pack/bundle/opt/deoplete.nvim b/nvim/.config/nvim/pack/bundle/opt/deoplete.nvim deleted file mode 160000 index 1c40f648..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/deoplete.nvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1c40f648d2b00e70beb4c473b7c0e32b633bd9ae diff --git a/nvim/.config/nvim/pack/bundle/opt/firenvim b/nvim/.config/nvim/pack/bundle/opt/firenvim deleted file mode 160000 index ff6b8f02..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/firenvim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ff6b8f022213c3d758478dad85d35febf92225e5 diff --git a/nvim/.config/nvim/pack/bundle/opt/fzf.vim b/nvim/.config/nvim/pack/bundle/opt/fzf.vim deleted file mode 160000 index d6aa2147..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/fzf.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d6aa21476b2854694e6aa7b0941b8992a906c5ec diff --git a/nvim/.config/nvim/pack/bundle/opt/gruvbox b/nvim/.config/nvim/pack/bundle/opt/gruvbox deleted file mode 160000 index bf2885a9..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/gruvbox +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bf2885a95efdad7bd5e4794dd0213917770d79b7 diff --git a/nvim/.config/nvim/pack/bundle/opt/gruvbox-baby b/nvim/.config/nvim/pack/bundle/opt/gruvbox-baby deleted file mode 160000 index 5bda6547..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/gruvbox-baby +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5bda65472020c62def1ca52e6de2c0c5ba47fc7a diff --git a/nvim/.config/nvim/pack/bundle/opt/lexima.vim b/nvim/.config/nvim/pack/bundle/opt/lexima.vim deleted file mode 160000 index 99ece675..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/lexima.vim +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 99ece6758ec49b04de983873e4117a390121fbb8 diff --git a/nvim/.config/nvim/pack/bundle/opt/nvim-lspconfig b/nvim/.config/nvim/pack/bundle/opt/nvim-lspconfig deleted file mode 160000 index 06e54cdf..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/nvim-lspconfig +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 06e54cdfa38c2129bc555b6ee77d4086c3a74e5c diff --git a/nvim/.config/nvim/pack/bundle/opt/nvim-treesitter b/nvim/.config/nvim/pack/bundle/opt/nvim-treesitter deleted file mode 160000 index dd4e6232..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/nvim-treesitter +++ /dev/null @@ -1 +0,0 @@ -Subproject commit dd4e62324ab1607aefdbeddc776489cf9826ee6e diff --git a/nvim/.config/nvim/pack/bundle/opt/ultisnips b/nvim/.config/nvim/pack/bundle/opt/ultisnips deleted file mode 160000 index 53e1921e..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/ultisnips +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 53e1921e3ef015ef658e540c0aa9c4835f9c18a6 diff --git a/nvim/.config/nvim/pack/bundle/opt/vim-fugitive b/nvim/.config/nvim/pack/bundle/opt/vim-fugitive deleted file mode 160000 index f9c0b8ea..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/vim-fugitive +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f9c0b8eafea641ba27fd261b2b244944f87e6fd4 diff --git a/nvim/.config/nvim/pack/bundle/opt/vim-json b/nvim/.config/nvim/pack/bundle/opt/vim-json deleted file mode 160000 index 3727f089..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/vim-json +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3727f089410e23ae113be6222e8a08dd2613ecf2 diff --git a/nvim/.config/nvim/pack/bundle/opt/vim-less b/nvim/.config/nvim/pack/bundle/opt/vim-less deleted file mode 160000 index 6e818d56..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/vim-less +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6e818d5614d5fc18d95a48c92b89e6db39f9e3d6 diff --git a/nvim/.config/nvim/pack/bundle/opt/vim-openscad b/nvim/.config/nvim/pack/bundle/opt/vim-openscad deleted file mode 160000 index 11ed1252..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/vim-openscad +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 11ed125209e2277d439cf6d0340c6fca263cb09b diff --git a/nvim/.config/nvim/pack/bundle/opt/vim-projectionist b/nvim/.config/nvim/pack/bundle/opt/vim-projectionist deleted file mode 160000 index ddfa49f9..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/vim-projectionist +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ddfa49f9ece73aca44d2b45d693e7b58adbf8f8c diff --git a/nvim/.config/nvim/pack/bundle/opt/vim-repeat b/nvim/.config/nvim/pack/bundle/opt/vim-repeat deleted file mode 160000 index 24afe922..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/vim-repeat +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 24afe922e6a05891756ecf331f39a1f6743d3d5a diff --git a/nvim/.config/nvim/pack/bundle/opt/vim-snippets b/nvim/.config/nvim/pack/bundle/opt/vim-snippets deleted file mode 160000 index 43ed873b..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/vim-snippets +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 43ed873ba09ac2d71992e773c68c75c6b85686c7 diff --git a/nvim/.config/nvim/pack/bundle/opt/vim-surround b/nvim/.config/nvim/pack/bundle/opt/vim-surround deleted file mode 160000 index aeb93327..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/vim-surround +++ /dev/null @@ -1 +0,0 @@ -Subproject commit aeb933272e72617f7c4d35e1f003be16836b948d diff --git a/nvim/.config/nvim/pack/bundle/opt/vim-tridactyl b/nvim/.config/nvim/pack/bundle/opt/vim-tridactyl deleted file mode 160000 index 784794dd..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/vim-tridactyl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 784794dd8854b1eee2a9e718b8b1d941a20516b6 diff --git a/nvim/.config/nvim/pack/bundle/opt/vim-vinegar b/nvim/.config/nvim/pack/bundle/opt/vim-vinegar deleted file mode 160000 index 43576e84..00000000 --- a/nvim/.config/nvim/pack/bundle/opt/vim-vinegar +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 43576e84d3034bccb1216f39f51ed36d945d7b96 diff --git a/nvim/.config/nvim/plugin/fzf.vim b/nvim/.config/nvim/plugin/fzf.vim deleted file mode 100644 index 97c1b71f..00000000 --- a/nvim/.config/nvim/plugin/fzf.vim +++ /dev/null @@ -1,22 +0,0 @@ -" Prefixes all of the fzf commands -let g:fzf_command_prefix = 'Fzf' - -let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.8 } } - -" Mappings for common Fzf commands -nnoremap f = :FzfFiles -nnoremap b = :FzfBuffers -nnoremap h = :FzfHelptags -" The space is important at the end of this mapping -nnoremap / = :FzfRg - -function! s:read_template_into_buffer(template) - " has to be a function to avoid the extra space fzf#run insers otherwise - execute '0r ~/Templates/'.a:template -endfunction - -command! -bang -nargs=* LoadTemplate call fzf#run({ - \ 'source': 'ls -1 ~/Templates', - \ 'down': 20, - \ 'sink': function('read_template_into_buffer') - \ }) diff --git a/nvim/.config/nvim/plugin/mappings.lua b/nvim/.config/nvim/plugin/mappings.lua new file mode 100644 index 00000000..4a856d2c --- /dev/null +++ b/nvim/.config/nvim/plugin/mappings.lua @@ -0,0 +1,125 @@ + + +-- Swap : and ; in normal mode +vim.keymap.set('n', ';',':', {desc="Swaps semi colon to colon"}) +vim.keymap.set('n', ':',';', {desc="Swaps semi colon to colon"}) + +-- Swap : and ; in visual mode +vim.keymap.set('v', ';',':', {desc="Swaps semi colon to colon"}) +vim.keymap.set('v', ':',';', {desc="Swaps semi colon to colon"}) + +-- Make jj in insert mode go to normal mode +vim.keymap.set('i', 'jj','', {desc="jj to escape"}) + + +-- Make ctrl+hjkl change focus between windows +vim.keymap.set('n', '','h', {desc="Move to left window"}) +vim.keymap.set('n', '','j', {desc="Move to below window"}) +vim.keymap.set('n', '','k', {desc="Move to above window"}) +vim.keymap.set('n', '','l', {desc="Move to left window"}) + +if vim.fn.has('clipboard') == 1 then + vim.keymap.set('v', '','"+y"', {desc="Copy to system clipboard"}) + vim.keymap.set('i', '','"+pa', {desc="Paste from system clipboard"}) +end + + +-- Fix previous spelling mistake in insert mode +-- Shamelessly taken from https://castel.dev/post/lecture-notes-1/ +-- u - break undo sequence (new change) +-- - go into normal mode +-- [s - go to previous spelling mistake +-- 1z= - change to the top spelling suggestion +-- `] - go to the end of the last changed word +-- a - enter insert mode +-- u - break undo sequence (new change) +vim.keymap.set('i', '','u[s1z=`]au', {desc="Fix previous spelling mistake"}) + +-- Do Shebang line +-- - go into normal mode +-- :silent - run command silently +-- s/^/…/ - write at the begining of the line +-- - used to seperate commands +-- filetype detect - attempt to detect filetype again +-- :nohlsearch - un-hilight the search pattern +vim.keymap.set('i', '', ':silent s/^/#!\\/usr\\/bin\\/env / filetype detect:nohlsearcho', {desc="do shebang line"}) + + +-- Makes delete key work properly in insert mode +vim.keymap.set('i', '', '', {desc="Delete next character"}) + + + +-- Compiles documents +-- The uppercase versions don't push enter an extra time resulting in seeing +-- the output of the compile command. Useful for debugging +vim.keymap.set('n', 'cc', ':w! | !compiler "%"' ) +vim.keymap.set('n', 'cC', ':w! | !compiler "%"' ) +vim.keymap.set('n', 'cl', ':w! | !compiler "%" letter' ) +vim.keymap.set('n', 'cL', ':w! | !compiler "%" letter' ) +vim.keymap.set('n', 'cf', ':w! | !rt partialPdf --overwrite "%" ' ) +vim.keymap.set('n', 'cF', ':w! | !rt partialPdf --overwrite "%" ' ) +vim.keymap.set('n', 'Cf', ':w! | !rt fullReport . --overwrite ' ) +vim.keymap.set('n', 'CF', ':w! | !rt fullReport . --overwrite ' ) + +-- Opens the compiled documents +-- If something like html, it doesn't need to be compiled first +vim.keymap.set('n', 'co', ':!opout "%"', {desc="open compiled document"}) + +-- Makes vim default to very magic searching +vim.keymap.set({'n','v'}, '/', '/\\v', {desc="very magic search"}) + +-- re-select visual selection when using < or > +vim.keymap.set('v', '<', '', '>gv', {desc="Increase indent and re-select"}) + + +-- Easy quickfix jumping +-- zO - Opens folds +-- zz - Centers vertically +vim.keymap.set('n', '[c', ':cpreviouszOzz', {desc="previous quickfix"}) +vim.keymap.set('n', ']c', ':cnextzOzz', {desc="next quickfix"}) + + +-- Debugging mappings +-- See `:help vim.diagnostic.*` for documentation on any of the below functions +vim.keymap.set('n', 'e', vim.diagnostic.open_float) +vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) +vim.keymap.set('n', ']d', vim.diagnostic.goto_next) +--vim.keymap.set('n', 'q', vim.diagnostic.setloclist) + +-- Open currend directory +vim.keymap.set('n', '-', ':e %:h', {desc="Open directory"}) + + + +-- Leaving these as old-style to remind me to come back and make them proper lua +vim.cmd([[ + +" Mappings for my encoding functions +vnoremap [b :call mine#encoding#wrapper('base64Encode') +vnoremap ]b :call mine#encoding#wrapper('base64Decode') +vnoremap [u :call mine#encoding#wrapper('urlEncode') +vnoremap ]u :call mine#encoding#wrapper('urlDecode') +vnoremap [U :call mine#encoding#wrapper('urlEncodeAll') +vnoremap ]U :call mine#encoding#wrapper('urlDecode') +vnoremap [h :call mine#encoding#wrapper('hexEncode') +vnoremap ]h :call mine#encoding#wrapper('hexDecode') + + +" Run proselint and put it in the quickfix list +nnoremap p :call mine#functions#proselint() + +if has('nvim') + if !empty($SUDO_ASKPASS) + cnoremap WW w !sudo -A tee % > /dev/null + else + cnoremap WW echo "SUDO_ASKPASS variable needs to be set" + endif +else + cnoremap WW w !sudo tee % > /dev/null +endif + +nnoremap ve :edit $HOME/.config/nvim/init.vim + +]]) diff --git a/nvim/.config/nvim/plugin/mappings.vim b/nvim/.config/nvim/plugin/mappings.vim deleted file mode 100644 index c26cceca..00000000 --- a/nvim/.config/nvim/plugin/mappings.vim +++ /dev/null @@ -1,95 +0,0 @@ -" Swaps semi colon to colon in normal mode -nnoremap ; : -nnoremap : ; - -" Swaps semi colon to colon in visual mode -vnoremap ; : -vnoremap : ; - -" Make jj in insert mode go to normal mode -inoremap jj - -" Make ctrl+hjkl change focus between windows -nnoremap h -nnoremap j -nnoremap k -nnoremap l - -if has('clipboard') - " Make Ctrl C and Ctrl V work on system clipboard - " if in visual or insert mode respectively - vnoremap "+y - inoremap "+pa -endif - -" Fix previous spelling mistake in insert mode -" Shamelessly taken from https://castel.dev/post/lecture-notes-1/ -" u - break undo sequence (new change) -" - go into normal mode -" [s - go to previous spelling mistake -" 1z= - change to the top spelling suggestion -" `] - go to the end of the last changed word -" a - enter insert mode -" u - break undo sequence (new change) -inoremap u[s1z=`]au - -" Do Shebang line -" - go into normal mode -" :silent - run command silently -" s/^/…/ - write at the begining of the line -" - used to seperate commands -" filetype detect - attempt to detect filetype again -" :nohlsearch - un-hilight the search pattern -inoremap :silent s/^/#!\/usr\/bin\/env / filetype detect:nohlsearcho -" alternative: inoremap :silent exe ".!which " s/^/#!/ filetype detectYpDi - -" Mappings for my encoding functions -vnoremap [b :call mine#encoding#wrapper('base64Encode') -vnoremap ]b :call mine#encoding#wrapper('base64Decode') -vnoremap [u :call mine#encoding#wrapper('urlEncode') -vnoremap ]u :call mine#encoding#wrapper('urlDecode') -vnoremap [U :call mine#encoding#wrapper('urlEncodeAll') -vnoremap ]U :call mine#encoding#wrapper('urlDecode') -vnoremap [h :call mine#encoding#wrapper('hexEncode') -vnoremap ]h :call mine#encoding#wrapper('hexDecode') - -" Makes the delete key work in insert mode -inoremap - -" Compiles documents -" The uppercase versions don't push enter an extra time resulting in seeing -" the output of the compile command. Useful for debugging -nnoremap cc :w! \| !compiler % -nnoremap cC :w! \| !compiler % -nnoremap cl :w! \| !compiler % letter -nnoremap cL :w! \| !compiler % letter - -" Opens the compiled documents -" If something like html, it doesn't need to be compiled first -nnoremap co :!opout % - -" Makes vim default to "very magic" searching -nnoremap / /\v -vnoremap / /\v - -" Makes vim re-select visual selection when using < or > -vnoremap < >gv - -nnoremap [c :cpreviouszOzz -nnoremap ]c :cnextzOzz - -" Run proselint and put it in the quickfix list -nnoremap p :call mine#functions#proselint() - -if has('nvim') - if !empty($SUDO_ASKPASS) - cnoremap WW w !sudo -A tee % > /dev/null - else - cnoremap WW echo "SUDO_ASKPASS variable needs to be set" - endif -else - cnoremap WW w !sudo tee % > /dev/null -endif - -nnoremap ve :edit $HOME/.config/nvim/init.vim diff --git a/nvim/.config/nvim/plugin/settings.lua b/nvim/.config/nvim/plugin/settings.lua new file mode 100644 index 00000000..b8c3aef4 --- /dev/null +++ b/nvim/.config/nvim/plugin/settings.lua @@ -0,0 +1,77 @@ +-- Set spellcheck language to english +vim.opt.spelllang=en_gb + +-- Set default split to be right or bottom +vim.opt.splitright=true +vim.opt.splitbelow=true + +-- Tell vim it's a fast terminal +vim.opt.ttyfast=true + +-- set relative ruler with current line as real line number +vim.opt.relativenumber=true +vim.opt.number=true + +-- Allows vim to background buffers without saving +vim.opt.hidden=true + +-- Sets vim to smart case +-- If search is all lowercase, search insensitively; if you include a capital +-- it becomes a case sensitive match +vim.opt.ignorecase=true +vim.opt.smartcase=true + +-- Makes vim try to keep 5 lines visible at the top and bottom +vim.opt.scrolloff=5 + +-- set tabwidth +vim.opt.autoindent=true +vim.opt.smartindent=true +vim.opt.shiftwidth=4 +vim.opt.tabstop=4 + +-- Add invisivle character reperesentation +vim.opt.list=true +vim.opt.listchars={ + tab="» ", + trail="␣" +} + +-- Stops vim wrapping in the middle of a word +vim.opt.linebreak=true + +-- Sets tool for opening non-text files with gx +-- If in netrw, this is run with just x +vim.g.netrw_browsex_viewer = "opout" + +-- Automatically insert comment leader after hitting enter (r) or when pushing o or O (o) +vim.opt.formatoptions:append('r') +vim.opt.formatoptions:append('o') + +-- Show the results of the substitute command as you type +vim.opt.inccommand = 'nosplit' + +-- Sets the default fold method to indent +vim.opt.foldmethod = 'indent' + + +-- Need to find out how to do this in lua +vim.cmd([[ + +if executable('rg') + set grepprg=rg\ --vimgrep\ --no-heading\ --color=never\ --glob=\"!shell-logs/*\" + set grepformat=%f:%l:%c:%m,%f:%l:%m +endif + +augroup colorcols + autocmd! + autocmd FileType,VimEnter,BufEnter * call mine#functions#colorcols() +augroup end + +" share data between nvim instances (registers etc) +augroup SHADA + autocmd! + autocmd CursorHold,TextYankPost,FocusGained,FocusLost * + \ if exists(':rshada') | rshada | wshada | endif +augroup END +]]) diff --git a/nvim/.config/nvim/plugin/settings.vim b/nvim/.config/nvim/plugin/settings.vim deleted file mode 100644 index c231053c..00000000 --- a/nvim/.config/nvim/plugin/settings.vim +++ /dev/null @@ -1,73 +0,0 @@ -" Set colourscheme to gruvbox -let g:gruvbox_italic=1 -set termguicolors -colorscheme gruvbox - -" Set spellcheck language to english -set spelllang=en_gb - -" Set default split to be right or bottom -set splitright -set splitbelow - -" Tell vim it's a fast terminal -set ttyfast - -" set relative ruler with current line as real line number -set relativenumber -set number - -" Allows vim to background buffers without saving -set hidden - -" Sets vim to smart case -" If search is all lowercase, search insensitively; if you include a capital -" it becomes a case sensitive match -set ignorecase smartcase - -" Makes vim try to keep 5 lines visible at the top and bottom -set scrolloff=5 - -" set tabwidth -set autoindent -set smartindent -set shiftwidth=4 -set tabstop=4 - -" Add invisivle character reperesentation -set list listchars=tab:»\ ,trail:\␣,eol:↩ - -" Stops vim wrapping in the middle of a word -set linebreak - -" Sets tool for opening non-text files with gx -" If in netrw, this is run with just x -let g:netrw_browsex_viewer = "opout" - -" Automatically insert comment leader after hitting enter -set formatoptions+=r -" Automatically insert comment leader after hitting o or O -set formatoptions+=o - -" Show the results of the substitute command as you type -set inccommand=nosplit - -" Sets the default fold method to indent -set foldmethod=indent - -if executable('rg') - set grepprg=rg\ --vimgrep\ --no-heading\ --color=never\ --glob=\"!shell-logs/*\" - set grepformat=%f:%l:%c:%m,%f:%l:%m -endif - -augroup colorcols - autocmd! - autocmd FileType,VimEnter,BufEnter * call mine#functions#colorcols() -augroup end - -" share data between nvim instances (registers etc) -augroup SHADA - autocmd! - autocmd CursorHold,TextYankPost,FocusGained,FocusLost * - \ if exists(':rshada') | rshada | wshada | endif -augroup END diff --git a/nvim/.config/nvim/plugin/treesitter.vim b/nvim/.config/nvim/plugin/treesitter.vim deleted file mode 100644 index 32681ea0..00000000 --- a/nvim/.config/nvim/plugin/treesitter.vim +++ /dev/null @@ -1,11 +0,0 @@ -lua <