From: Georgios Atheridis Date: Sun, 5 Jun 2022 06:15:29 +0000 (+0300) Subject: added nvim with lua only, renamed older nvim without lua X-Git-Url: https://git.atheridis.org/?a=commitdiff_plain;h=c721b14f40720d5346a07934a0bacfbd94fd5a26;p=configs%2Fneovim.git added nvim with lua only, renamed older nvim without lua --- diff --git a/coc-settings.json b/coc-settings.json deleted file mode 100644 index 35a3216..0000000 --- a/coc-settings.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "diagnostic-languageserver.formatFiletypes": { - "python": [ - "black", - "isort", - "docformatter" - ] - }, - "diagnostic-languageserver.formatters": { - "black": { - "command": "black", - "args": [ - "-q", - "-" - ] - }, - "isort": { - "command": "isort", - "args": [ - "-q", - "-" - ] - }, - "docformatter": { - "command": "docformatter", - "args": [ - "-" - ] - } - }, - "diagnostic-languageserver.filetypes": { - "python": "flake8" - }, - "diagnostic-languageserver.linters": { - "flake8": { - "sourceName": "flake8", - "command": "flake8", - "debounce": 200, - "rootPatterns": [ - ".git", - "pyproject.toml", - "setup.py" - ], - "args": [ - "--ignore=E402,C901,W503,W504,E116,E702,C0103,C0114,C0115,C0116,C0103,C0301,W0613,W0102,R0903,R0902,R0914,R0915,R0205,W0703,W0702,W0603", - "--format=%(row)d,%(col)d,%(code).1s,%(code)s: %(text)s", - "--max-line-length=88", - "-" - ], - "offsetLine": 0, - "offsetColumn": 0, - "formatLines": 1, - "formatPattern": [ - "(\\d+),(\\d+),([A-Z]),(.*)(\\r|\\n)*$", - { - "line": 1, - "column": 2, - "security": 3, - "message": 4 - } - ], - "securities": { - "W": "info", - "E": "warning", - "F": "info", - "C": "info", - "N": "hint" - } - } - }, - "coc.preferences.formatOnSaveFiletypes": [ - "c", - "cpp", - "css", - "markdown", - "javascript", - "graphql", - "html", - "yaml", - "json", - "python", - "rust", - "toml" - ], - "html.filetypes": [ - "html", - "handlebars", - "htmldjango", - "blade", - "jinja" - ] -} diff --git a/init.vim b/init.vim deleted file mode 100644 index 56d6dd1..0000000 --- a/init.vim +++ /dev/null @@ -1,15 +0,0 @@ -for f in split(glob('$HOME/.config/nvim/vim_settings/*/*.vim'), '\n') - exe 'source' f -endfor - -for f in split(glob('$HOME/.config/nvim/vim_settings/*.vim'), '\n') - exe 'source' f -endfor - -for f in split(glob('$HOME/.config/nvim/plug_settings/*/*.vim'), '\n') - exe 'source' f -endfor - -for f in split(glob('$HOME/.config/nvim/plug_settings/*.vim'), '\n') - exe 'source' f -endfor diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..c020c10 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,7 @@ +require("nvim.options") +require("nvim.keymaps") +require("nvim.plugins") +require("nvim.colorscheme") +require("nvim.cmp") +require("nvim.lsp") +require("nvim.autopairs") diff --git a/nvim/lua/nvim/autopairs.lua b/nvim/lua/nvim/autopairs.lua new file mode 100644 index 0000000..6e31b09 --- /dev/null +++ b/nvim/lua/nvim/autopairs.lua @@ -0,0 +1,25 @@ +-- If you want insert `(` after select function or method item +local status_ok, npairs = pcall(require, "nvim-autopairs") +if not status_ok then + return +end + +npairs.setup ({ + check_ts = true, + ts_config = { + lua = {"string"}, -- it will not add a pair on that treesitter node + javascript = {"template_string"}, + java = false, -- don't check treesitter on java + } +}) + +local cmp_autopairs = require('nvim-autopairs.completion.cmp') +local cmp_status_ok, cmp = pcall(require, "cmp") +if not cmp_status_ok then + return +end +cmp.event:on( 'confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } })) + + +-- add a lisp filetype (wrap my-function), FYI: Hardcoded = { "clojure", "clojurescript", "fennel", "janet" } +cmp_autopairs.lisp[#cmp_autopairs.lisp+1] = "racket" diff --git a/nvim/lua/nvim/cmp.lua b/nvim/lua/nvim/cmp.lua new file mode 100644 index 0000000..711d6a7 --- /dev/null +++ b/nvim/lua/nvim/cmp.lua @@ -0,0 +1,136 @@ +local cmp_status_ok, cmp = pcall(require, "cmp") +if not cmp_status_ok then + print("Error loading cmp") + return +end + +local snip_status_ok, luasnip = pcall(require, "luasnip") +if not snip_status_ok then + print("Error loading snip") + return +end + +require("luasnip/loaders/from_vscode").lazy_load() + +local check_backspace = function() + local col = vim.fn.col "." - 1 + return col == 0 or vim.fn.getline("."):sub(col, col):match "%s" +end + +--   פּ ﯟ   some other good icons +local kind_icons = { + Text = "", + Method = "m", + Function = "", + Constructor = "", + Field = "", + Variable = "", + Class = "", + Interface = "", + Module = "", + Property = "", + Unit = "", + Value = "", + Enum = "", + Keyword = "", + Snippet = "", + Color = "", + File = "", + Reference = "", + Folder = "", + EnumMember = "", + Constant = "", + Struct = "", + Event = "", + Operator = "", + TypeParameter = "", +} + +cmp.setup { + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = { + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping(cmp.mapping.scroll_docs(-1), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.scroll_docs(1), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }), + [""] = cmp.mapping { + i = cmp.mapping.abort(), + c = cmp.mapping.close(), + }, + [""] = cmp.mapping.confirm { select = false }, + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expandable() then + luasnip.expand() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif check_backspace() then + fallback() + else + fallback() + end + end, { + "i", + "s", + }), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { + "i", + "s", + }), + }, + formatting = { + fields = { "kind", "abbr", "menu" }, + }, + sources = { + { name = "nvim_lsp" }, + { name = "nvim_lua" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" }, + }, + confirm_opts = { + behavior = cmp.ConfirmBehavior.Replace, + select = false, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + experimental = { + ghost_text = true, + }, +} + +-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). +cmp.setup.cmdline('/', { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' } + } +}) + +-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). +cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) +}) diff --git a/nvim/lua/nvim/colorscheme.lua b/nvim/lua/nvim/colorscheme.lua new file mode 100644 index 0000000..7c7ca34 --- /dev/null +++ b/nvim/lua/nvim/colorscheme.lua @@ -0,0 +1,10 @@ +local status_ok, onedark = pcall(require, "onedark") +if not status_ok then + vim.notify("Error with colorscheme") + return +end + +onedark.setup { + style = "deep" +} +onedark.load() diff --git a/nvim/lua/nvim/keymaps.lua b/nvim/lua/nvim/keymaps.lua new file mode 100644 index 0000000..fdce539 --- /dev/null +++ b/nvim/lua/nvim/keymaps.lua @@ -0,0 +1,66 @@ +local opts = { noremap = true, silent = true } + +local function nnoremap(shortcut, command) + vim.keymap.set("n", shortcut, command, opts) +end +local function inoremap(shortcut, command) + vim.keymap.set("i", shortcut, command, opts) +end +local function vnoremap(shortcut, command) + vim.keymap.set("v", shortcut, command, opts) +end +local function xnoremap(shortcut, command) + vim.keymap.set("x", shortcut, command, opts) +end +local function tnoremap(shortcut, command) + vim.keymap.set("t", shortcut, command, opts) +end + +-- Define leader key +-- vim.api.nvim_set_keymap("", "", "", opts) +vim.g.mapleader = "\\" +vim.g.maplocalleader = "\\" + +-- Sane Y behaviour +nnoremap("Y", "y$") + +-- Better window navigation +nnoremap("", "h") +nnoremap("", "j") +nnoremap("", "k") +nnoremap("", "l") + +nnoremap("e", ":Lex 15") + +-- Resize +nnoremap("", ":vertical resize -2") +nnoremap("", ":resize +2") +nnoremap("", ":resize -2") +nnoremap("", ":vertical resize +2") + +-- Navigate Buffers +nnoremap("", ":bnext") +nnoremap("", ":bprevious") + +-- Quick ESC +inoremap("jk", "") + +-- Don't copy replaced text into register +-- while in visual mode, when pasting +vnoremap("p", "\"_dP") + +-- Move text up and down +vnoremap("", ":m .+1==") +vnoremap("", ":m .-2==") + +xnoremap("J", ":move '>+1gv-gv", opts) +xnoremap("K", ":move '<-2gv-gv", opts) +xnoremap("", ":move '>+1gv-gv", opts) +xnoremap("", ":move '<-2gv-gv", opts) + +-- Terminal -- +-- Better terminal navigation +tnoremap("", "h") +tnoremap("", "j") +tnoremap("", "k") +tnoremap("", "l") diff --git a/nvim/lua/nvim/lsp/handlers.lua b/nvim/lua/nvim/lsp/handlers.lua new file mode 100644 index 0000000..551a526 --- /dev/null +++ b/nvim/lua/nvim/lsp/handlers.lua @@ -0,0 +1,104 @@ +local M = {} + +-- TODO: backfill this to template +M.setup = function() + local signs = { + { name = "DiagnosticSignError", text = "" }, + { name = "DiagnosticSignWarn", text = "" }, + { name = "DiagnosticSignHint", text = "" }, + { name = "DiagnosticSignInfo", text = "" }, + } + + for _, sign in ipairs(signs) do + vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" }) + end + + local config = { + -- disable virtual text + virtual_text = true, + -- show signs + signs = { + active = signs, + }, + update_in_insert = true, + underline = true, + severity_sort = true, + float = { + focusable = false, + style = "minimal", + border = "rounded", + source = "always", + header = "", + prefix = "", + }, + } + + vim.diagnostic.config(config) + + vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { + border = "rounded", + }) + + vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { + border = "rounded", + }) +end + +local function lsp_highlight_document(client) + -- Set autocommands conditional on server_capabilities + if client.resolved_capabilities.document_highlight then + vim.api.nvim_exec( + [[ + augroup lsp_document_highlight + autocmd! * + autocmd CursorHold lua vim.lsp.buf.document_highlight() + autocmd CursorMoved lua vim.lsp.buf.clear_references() + augroup END + ]], + false + ) + end +end + +local function lsp_keymaps(bufnr) + local opts = { noremap = true, silent = true } + vim.api.nvim_buf_set_keymap(bufnr, "n", "gD", "lua vim.lsp.buf.declaration()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "gd", "lua vim.lsp.buf.definition()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "K", "lua vim.lsp.buf.hover()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "gi", "lua vim.lsp.buf.implementation()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "", "lua vim.lsp.buf.signature_help()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "rn", "lua vim.lsp.buf.rename()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "gr", "lua vim.lsp.buf.references()", opts) + -- vim.api.nvim_buf_set_keymap(bufnr, "n", "ca", "lua vim.lsp.buf.code_action()", opts) + -- vim.api.nvim_buf_set_keymap(bufnr, "n", "f", "lua vim.diagnostic.open_float()", opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "[d", 'lua vim.diagnostic.goto_prev({ border = "rounded" })', opts) + vim.api.nvim_buf_set_keymap( + bufnr, + "n", + "gl", + 'lua vim.lsp.diagnostic.show_line_diagnostics({ border = "rounded" })', + opts + ) + vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", 'lua vim.diagnostic.goto_next({ border = "rounded" })', opts) + vim.api.nvim_buf_set_keymap(bufnr, "n", "q", "lua vim.diagnostic.setloclist()", opts) + vim.cmd [[ command! Format execute 'lua vim.lsp.buf.formatting()' ]] +end + +M.on_attach = function(client, bufnr) + if client.name == "tsserver" then + client.resolved_capabilities.document_formatting = false + end + lsp_keymaps(bufnr) + lsp_highlight_document(client) +end + +local capabilities = vim.lsp.protocol.make_client_capabilities() + +local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") +if not status_ok then + return +end + +M.capabilities = cmp_nvim_lsp.update_capabilities(capabilities) + +return M diff --git a/nvim/lua/nvim/lsp/init.lua b/nvim/lua/nvim/lsp/init.lua new file mode 100644 index 0000000..e66a929 --- /dev/null +++ b/nvim/lua/nvim/lsp/init.lua @@ -0,0 +1,8 @@ +local status_ok, _ = pcall(require, "lspconfig") +if not status_ok then + print("Error with lspconfig") + return +end + +require("nvim.lsp.lsp-installer") +require("nvim.lsp.handlers").setup() diff --git a/nvim/lua/nvim/lsp/lsp-installer.lua b/nvim/lua/nvim/lsp/lsp-installer.lua new file mode 100644 index 0000000..2ceb9ac --- /dev/null +++ b/nvim/lua/nvim/lsp/lsp-installer.lua @@ -0,0 +1,38 @@ +local status_ok, lsp_installer = pcall(require, "nvim-lsp-installer") +if not status_ok then + print("Error with nvim-lsp-installer") + return +end + +-- Register a handler that will be called for all installed servers. +-- Alternatively, you may also register handlers on specific server instances instead (see example below). +lsp_installer.on_server_ready(function(server) + local opts = { + on_attach = require("nvim.lsp.handlers").on_attach, + capabilities = require("nvim.lsp.handlers").capabilities, + } + + if server.name == "jsonls" then + local jsonls_opts = require("nvim.lsp.settings.jsonls") + opts = vim.tbl_deep_extend("force", jsonls_opts, opts) + end + + if server.name == "sumneko_lua" then + local sumneko_opts = require("nvim.lsp.settings.sumneko_lua") + opts = vim.tbl_deep_extend("force", sumneko_opts, opts) + end + + if server.name == "pyright" then + local pyright_opts = require("nvim.lsp.settings.pyright") + opts = vim.tbl_deep_extend("force", pyright_opts, opts) + end + + if server.name == "jedi_language_server" then + local jedi_opts = require("nvim.lsp.settings.jedi_language_server") + opts = vim.tbl_deep_extend("force", jedi_opts, opts) + end + + -- This setup() function is exactly the same as lspconfig's setup function. + -- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md + server:setup(opts) +end) diff --git a/nvim/lua/nvim/lsp/settings/jedi_language_server.lua b/nvim/lua/nvim/lsp/settings/jedi_language_server.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/nvim/lua/nvim/lsp/settings/jedi_language_server.lua @@ -0,0 +1 @@ +return {} diff --git a/nvim/lua/nvim/lsp/settings/jsonls.lua b/nvim/lua/nvim/lsp/settings/jsonls.lua new file mode 100644 index 0000000..be362c9 --- /dev/null +++ b/nvim/lua/nvim/lsp/settings/jsonls.lua @@ -0,0 +1,183 @@ +-- Find more schemas here: https://www.schemastore.org/json/ +local schemas = { + { + description = "TypeScript compiler configuration file", + fileMatch = { + "tsconfig.json", + "tsconfig.*.json", + }, + url = "https://json.schemastore.org/tsconfig.json", + }, + { + description = "Lerna config", + fileMatch = { "lerna.json" }, + url = "https://json.schemastore.org/lerna.json", + }, + { + description = "Babel configuration", + fileMatch = { + ".babelrc.json", + ".babelrc", + "babel.config.json", + }, + url = "https://json.schemastore.org/babelrc.json", + }, + { + description = "ESLint config", + fileMatch = { + ".eslintrc.json", + ".eslintrc", + }, + url = "https://json.schemastore.org/eslintrc.json", + }, + { + description = "Bucklescript config", + fileMatch = { "bsconfig.json" }, + url = "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/8.2.0/docs/docson/build-schema.json", + }, + { + description = "Prettier config", + fileMatch = { + ".prettierrc", + ".prettierrc.json", + "prettier.config.json", + }, + url = "https://json.schemastore.org/prettierrc", + }, + { + description = "Vercel Now config", + fileMatch = { "now.json" }, + url = "https://json.schemastore.org/now", + }, + { + description = "Stylelint config", + fileMatch = { + ".stylelintrc", + ".stylelintrc.json", + "stylelint.config.json", + }, + url = "https://json.schemastore.org/stylelintrc", + }, + { + description = "A JSON schema for the ASP.NET LaunchSettings.json files", + fileMatch = { "launchsettings.json" }, + url = "https://json.schemastore.org/launchsettings.json", + }, + { + description = "Schema for CMake Presets", + fileMatch = { + "CMakePresets.json", + "CMakeUserPresets.json", + }, + url = "https://raw.githubusercontent.com/Kitware/CMake/master/Help/manual/presets/schema.json", + }, + { + description = "Configuration file as an alternative for configuring your repository in the settings page.", + fileMatch = { + ".codeclimate.json", + }, + url = "https://json.schemastore.org/codeclimate.json", + }, + { + description = "LLVM compilation database", + fileMatch = { + "compile_commands.json", + }, + url = "https://json.schemastore.org/compile-commands.json", + }, + { + description = "Config file for Command Task Runner", + fileMatch = { + "commands.json", + }, + url = "https://json.schemastore.org/commands.json", + }, + { + description = "AWS CloudFormation provides a common language for you to describe and provision all the infrastructure resources in your cloud environment.", + fileMatch = { + "*.cf.json", + "cloudformation.json", + }, + url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/cloudformation.schema.json", + }, + { + description = "The AWS Serverless Application Model (AWS SAM, previously known as Project Flourish) extends AWS CloudFormation to provide a simplified way of defining the Amazon API Gateway APIs, AWS Lambda functions, and Amazon DynamoDB tables needed by your serverless application.", + fileMatch = { + "serverless.template", + "*.sam.json", + "sam.json", + }, + url = "https://raw.githubusercontent.com/awslabs/goformation/v5.2.9/schema/sam.schema.json", + }, + { + description = "Json schema for properties json file for a GitHub Workflow template", + fileMatch = { + ".github/workflow-templates/**.properties.json", + }, + url = "https://json.schemastore.org/github-workflow-template-properties.json", + }, + { + description = "golangci-lint configuration file", + fileMatch = { + ".golangci.toml", + ".golangci.json", + }, + url = "https://json.schemastore.org/golangci-lint.json", + }, + { + description = "JSON schema for the JSON Feed format", + fileMatch = { + "feed.json", + }, + url = "https://json.schemastore.org/feed.json", + versions = { + ["1"] = "https://json.schemastore.org/feed-1.json", + ["1.1"] = "https://json.schemastore.org/feed.json", + }, + }, + { + description = "Packer template JSON configuration", + fileMatch = { + "packer.json", + }, + url = "https://json.schemastore.org/packer.json", + }, + { + description = "NPM configuration file", + fileMatch = { + "package.json", + }, + url = "https://json.schemastore.org/package.json", + }, + { + description = "JSON schema for Visual Studio component configuration files", + fileMatch = { + "*.vsconfig", + }, + url = "https://json.schemastore.org/vsconfig.json", + }, + { + description = "Resume json", + fileMatch = { "resume.json" }, + url = "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json", + }, +} + +local opts = { + settings = { + json = { + schemas = schemas, + }, + }, + setup = { + commands = { + Format = { + function() + vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line "$", 0 }) + end, + }, + }, + }, +} + +return opts diff --git a/nvim/lua/nvim/lsp/settings/pyright.lua b/nvim/lua/nvim/lsp/settings/pyright.lua new file mode 100644 index 0000000..c43621d --- /dev/null +++ b/nvim/lua/nvim/lsp/settings/pyright.lua @@ -0,0 +1,9 @@ +return { + settings = { + python = { + analysis = { + typeCheckingMode = "strict", + } + } + }, +} diff --git a/nvim/lua/nvim/lsp/settings/sumneko_lua.lua b/nvim/lua/nvim/lsp/settings/sumneko_lua.lua new file mode 100644 index 0000000..9848bdd --- /dev/null +++ b/nvim/lua/nvim/lsp/settings/sumneko_lua.lua @@ -0,0 +1,15 @@ +return { + settings = { + Lua = { + diagnostics = { + globals = { "vim" }, + }, + workspace = { + library = { + [vim.fn.expand("$VIMRUNTIME/lua")] = true, + [vim.fn.stdpath("config") .. "/lua"] = true, + }, + }, + }, + }, +} diff --git a/nvim/lua/nvim/options.lua b/nvim/lua/nvim/options.lua new file mode 100644 index 0000000..3345b79 --- /dev/null +++ b/nvim/lua/nvim/options.lua @@ -0,0 +1,40 @@ +local options = { + backup = false, + clipboard = "unnamedplus", + cmdheight = 1, + completeopt = { "menuone", "noselect" }, + conceallevel = 0, + fileencoding = "utf-8", + hlsearch = false, + showtabline = 4, + pumheight = 10, + smartcase = true, + smartindent = true, + smartindent = true, + splitbelow = true, + splitright = true, + swapfile = false, + termguicolors = true, + timeoutlen = 1000, + undofile = true, + updatetime = 300, + writebackup = false, + expandtab = true, + shiftwidth = 4, + tabstop = 4, + number = true, + relativenumber = true, + cursorline = true, + numberwidth = 4, + signcolumn = "yes", + wrap = false, + scrolloff = 8, + sidescrolloff = 8, + guifont = "monospace:h17", +} + +vim.opt.shortmess:append "c" + +for k, v in pairs(options) do + vim.opt[k] = v +end diff --git a/nvim/lua/nvim/plugins.lua b/nvim/lua/nvim/plugins.lua new file mode 100644 index 0000000..836e0ac --- /dev/null +++ b/nvim/lua/nvim/plugins.lua @@ -0,0 +1,100 @@ +local fn = vim.fn + +-- Automatically install packer +local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim" +if fn.empty(fn.glob(install_path)) > 0 then + PACKER_BOOTSTRAP = fn.system { + "git", + "clone", + "--depth", + "1", + "https://github.com/wbthomason/packer.nvim", + install_path, + } + print "Installing packer close and reopen Neovim ... " + vim.cmd [[packadd packer.nvim]] +end + +-- Autocommand that reloads neovim whenver you save the plugins.lua file +vim.cmd [[ + augroup packer_user_config + autocmd! + autocmd BufWritePost plugins.lua source | PackerSync + augroup end +]] + +-- Use a protected call so we don't error out on the first use +local status_ok, packer = pcall(require, "packer") +if not status_ok then + vim.notify("Error with require packer") + return +end + +packer.init { + display = { + open_fn = function() + return require("packer.util").float {} + end, + }, +} + +-- Install plugins here +return packer.startup(function(use) + use "wbthomason/packer.nvim" -- Have packer manage itself + + + + -- PLUGINS BEGIN -- + -- An implementation of the Popup API from vim in Neovim + use "nvim-lua/popup.nvim" + + -- Useful lua functions used by lots of plugins + use "nvim-lua/plenary.nvim" + + -- Preview markdown files + use({ + "iamcco/markdown-preview.nvim", + run = function() vim.fn["mkdp#util#install"]() end, + }) + + -- Colorschemes + use "navarasu/onedark.nvim" + + -- cmp Plugins + use 'hrsh7th/nvim-cmp' + use 'hrsh7th/cmp-buffer' + use 'hrsh7th/cmp-path' + use 'hrsh7th/cmp-cmdline' + use 'saadparwaiz1/cmp_luasnip' + use 'hrsh7th/cmp-nvim-lsp' + use 'hrsh7th/cmp-nvim-lua' + + -- snippets + use 'L3MON4D3/LuaSnip' + use "rafamadriz/friendly-snippets" -- a bunch of snippets to use + + -- LSP + use "neovim/nvim-lspconfig" -- enable LSP + use "williamboman/nvim-lsp-installer" -- simple to use language server installer + + -- Commenter + use { + 'numToStr/Comment.nvim', + config = function() + require('Comment').setup() + end + } + + -- Autopairs + use "windwp/nvim-autopairs" + -- PLUGINS END -- + + + + + -- Automatically set up your configuration after cloning packer.nvim + -- Put this at the end after all plugins + if PACKER_BOOTSTRAP then + require("packer").sync() + end +end) diff --git a/nvim_0-4-4/coc-settings.json b/nvim_0-4-4/coc-settings.json new file mode 100644 index 0000000..9adbd42 --- /dev/null +++ b/nvim_0-4-4/coc-settings.json @@ -0,0 +1,92 @@ +{ + "diagnostic-languageserver.formatFiletypes": { + "python": [ + "black", + "isort", + "docformatter" + ] + }, + "diagnostic-languageserver.formatters": { + "black": { + "command": "black", + "args": [ + "-q", + "-" + ] + }, + "isort": { + "command": "isort", + "args": [ + "-q", + "-" + ] + }, + "docformatter": { + "command": "docformatter", + "args": [ + "-" + ] + } + }, + "diagnostic-languageserver.filetypes": { + "python": "flake8-black" + }, + "diagnostic-languageserver.linters": { + "flake8": { + "sourceName": "flake8", + "command": "flake8", + "debounce": 200, + "rootPatterns": [ + ".git", + "pyproject.toml", + "setup.py" + ], + "args": [ + "--ignore=E203,E402,C901,W503,W504,E116,E702,C0103,C0114,C0115,C0116,C0103,C0301,W0613,W0102,R0903,R0902,R0914,R0915,R0205,W0703,W0702,W0603", + "--format=%(row)d,%(col)d,%(code).1s,%(code)s: %(text)s", + "--max-line-length=88", + "-" + ], + "offsetLine": 0, + "offsetColumn": 0, + "formatLines": 1, + "formatPattern": [ + "(\\d+),(\\d+),([A-Z]),(.*)(\\r|\\n)*$", + { + "line": 1, + "column": 2, + "security": 3, + "message": 4 + } + ], + "securities": { + "W": "info", + "E": "warning", + "F": "info", + "C": "info", + "N": "hint" + } + } + }, + "coc.preferences.formatOnSaveFiletypes": [ + "c", + "cpp", + "css", + "markdown", + "javascript", + "graphql", + "html", + "yaml", + "json", + "python", + "rust", + "toml" + ], + "html.filetypes": [ + "html", + "handlebars", + "htmldjango", + "blade", + "jinja" + ] +} diff --git a/nvim_0-4-4/init.vim b/nvim_0-4-4/init.vim new file mode 100644 index 0000000..0036c5d --- /dev/null +++ b/nvim_0-4-4/init.vim @@ -0,0 +1,16 @@ +for f in split(glob('$HOME/.config/nvim/vim_settings/*/*.vim'), '\n') + exe 'source' f +endfor + +for f in split(glob('$HOME/.config/nvim/vim_settings/*.vim'), '\n') + exe 'source' f +endfor + +for f in split(glob('$HOME/.config/nvim/plug_settings/*/*.vim'), '\n') + exe 'source' f +endfor + +for f in split(glob('$HOME/.config/nvim/plug_settings/*.vim'), '\n') + exe 'source' f +endfor + diff --git a/nvim_0-4-4/plug_settings/autopairs/settings.vim b/nvim_0-4-4/plug_settings/autopairs/settings.vim new file mode 100644 index 0000000..93edb3f --- /dev/null +++ b/nvim_0-4-4/plug_settings/autopairs/settings.vim @@ -0,0 +1 @@ +au FileType jinja.html let b:AutoPairs = AutoPairsDefine({'{%' : '%}'}) diff --git a/nvim_0-4-4/plug_settings/coc/mappings.vim b/nvim_0-4-4/plug_settings/coc/mappings.vim new file mode 100644 index 0000000..b1b0412 --- /dev/null +++ b/nvim_0-4-4/plug_settings/coc/mappings.vim @@ -0,0 +1,45 @@ +" Coc Mappings + +" Use `[g` and `]g` to navigate diagnostics +" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. +nmap [g (coc-diagnostic-prev) +nmap ]g (coc-diagnostic-next) + +" GoTo code navigation. +nmap gd (coc-definition) +nmap gy (coc-type-definition) +nmap gi (coc-implementation) +nmap gr (coc-references) + +" Formatting selected code +xmap f (coc-format-selected) +nmap f (coc-format-selected) + +augroup mygroup + autocmd! + " Setup formatexpr specified filetype(s). + autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') + " Update signature help on jump placeholder. + autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') +augroup end + +" Symbol renaming +nnoremap rn (coc-rename) + +" Use tab for trigger completion with characters ahead and navigate. +" NOTE: Use command ':verbose imap ' to make sure tab is not mapped by +" other plugin before putting this into your config. +inoremap + \ pumvisible() ? "\" : + \ CheckBackspace() ? "\" : + \ coc#refresh() +inoremap pumvisible() ? "\" : "\" + +function! CheckBackspace() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + +" Use to trigger completion +inoremap pumvisible() ? "" : "\r" + diff --git a/nvim_0-4-4/plug_settings/coc/settings.vim b/nvim_0-4-4/plug_settings/coc/settings.vim new file mode 100644 index 0000000..197c585 --- /dev/null +++ b/nvim_0-4-4/plug_settings/coc/settings.vim @@ -0,0 +1,3 @@ +" Highlight the symbol and its references when holding the cursor +autocmd CursorHold * silent call CocActionAsync('highlight') + diff --git a/nvim_0-4-4/plug_settings/floaterm/mappings.vim b/nvim_0-4-4/plug_settings/floaterm/mappings.vim new file mode 100644 index 0000000..98d895e --- /dev/null +++ b/nvim_0-4-4/plug_settings/floaterm/mappings.vim @@ -0,0 +1,6 @@ +" Floaterm +let g:floaterm_keymap_toggle = '' +let g:floaterm_keymap_prev = '' +let g:floaterm_keymap_next = '' +let g:floaterm_keymap_new = '' +let g:floaterm_keymap_kill = '' diff --git a/nvim_0-4-4/plug_settings/nerdtree/mappings.vim b/nvim_0-4-4/plug_settings/nerdtree/mappings.vim new file mode 100644 index 0000000..bf92ab9 --- /dev/null +++ b/nvim_0-4-4/plug_settings/nerdtree/mappings.vim @@ -0,0 +1,3 @@ +nnoremap n :NERDTree +nnoremap e :NERDTreeToggle +nnoremap f :NERDTreeFocus diff --git a/nvim_0-4-4/plug_settings/nerdtree/settings.vim b/nvim_0-4-4/plug_settings/nerdtree/settings.vim new file mode 100644 index 0000000..e02692f --- /dev/null +++ b/nvim_0-4-4/plug_settings/nerdtree/settings.vim @@ -0,0 +1,22 @@ +let g:NERDTreeGitStatusUseNerdFonts = 1 +let g:NERDTreeHighlightCursorline = 0 +let g:NERDTreeShowHidden = 0 + +let g:NERDTreeIgnore = [ + \ '__pycache__', + \ '.\.so', + \ 'build', + \ 'develop-eggs', + \ 'dist', + \ 'downloads', + \ 'eggs', + \ '.\.egg-info', + \ '__pypackages__', + \ '\.env', + \ '\.venv', + \ 'env', + \ 'venv', + \ 'ENV', + \ 'env\.bak', + \ 'venv\.bak' +\] diff --git a/nvim_0-4-4/plug_settings/scope/settings.vim b/nvim_0-4-4/plug_settings/scope/settings.vim new file mode 100644 index 0000000..bf67c8d --- /dev/null +++ b/nvim_0-4-4/plug_settings/scope/settings.vim @@ -0,0 +1,13 @@ +augroup qs_colors + autocmd! + autocmd ColorScheme * highlight QuickScopePrimary + \ guifg='#00ff00' + \ gui=underline + \ ctermfg=155 + \ cterm=underline + autocmd ColorScheme * highlight QuickScopeSecondary + \ guifg='#0ffff' + \ gui=underline + \ ctermfg=81 + \ cterm=underline +augroup END diff --git a/nvim_0-4-4/plug_settings/startify/settings.vim b/nvim_0-4-4/plug_settings/startify/settings.vim new file mode 100644 index 0000000..5cb5ae1 --- /dev/null +++ b/nvim_0-4-4/plug_settings/startify/settings.vim @@ -0,0 +1,38 @@ +let g:startify_session_dir = '~/.config/nvim/session' + +let g:startify_lists = [ + \ { 'type': 'files', 'header': [' Files'] }, + \ { 'type': 'dir', 'header': [' Current Directory '. getcwd()] }, + \ { 'type': 'sessions', 'header': [' Sessions'] }, + \ { 'type': 'bookmarks', 'header': [' Bookmarks'] }, + \ ] + +let g:startify_bookmarks = [ + \ { 'in': '~/.config/nvim/init.vim' }, + \ { 'b': '~/.bashrc' } + \ ] + +" You can automatically restart a session like this +let g:startify_session_autoload = 1 + +let g:startify_change_to_dir = 1 + +let g:startify_session_delete_buffers = 1 + +let g:startify_change_to_vcs_root = 1 + +let g:startify_fortune_use_unicode = 1 + +let g:startify_session_persistence = 1 + +let g:startify_enable_special = 0 + +let g:startify_custom_header = [ + \ ' __ __ _ ___ ', + \ ' \ \/ /___ _______ ______ ____ | | / (_)___ ___ ', + \ ' \ / __ \/ ___/ / / / __ `/ __ \ | | / / / __ `__ \', + \ ' / / /_/ / / / /_/ / /_/ / /_/ / | |/ / / / / / / /', + \ ' /_/\____/_/ \__,_/\__, /\____/ |___/_/_/ /_/ /_/ ', + \ ' /____/ ', + \] + diff --git a/nvim_0-4-4/plug_settings/theme/airline.vim b/nvim_0-4-4/plug_settings/theme/airline.vim new file mode 100644 index 0000000..2991bab --- /dev/null +++ b/nvim_0-4-4/plug_settings/theme/airline.vim @@ -0,0 +1,5 @@ +let g:airline_powerline_fonts = 1 +let g:airline#extensions#tabline#enabled = 1 +let g:airline#extensions#branch#enabled = 1 + +let g:airline_section_z = '%3p%% %3l:%2c' diff --git a/nvim_0-4-4/plug_settings/theme/color.vim b/nvim_0-4-4/plug_settings/theme/color.vim new file mode 100644 index 0000000..973ad9f --- /dev/null +++ b/nvim_0-4-4/plug_settings/theme/color.vim @@ -0,0 +1,3 @@ +set background=dark +colo pop-punk +let g:airline_theme='pop_punk' diff --git a/nvim_0-4-4/vim_settings/mappings.vim b/nvim_0-4-4/vim_settings/mappings.vim new file mode 100644 index 0000000..259b3db --- /dev/null +++ b/nvim_0-4-4/vim_settings/mappings.vim @@ -0,0 +1,66 @@ +" Autocomplete navigation +inoremap ("\") +inoremap ("\") +inoremap ("\a") + +" Buffer navigation +nnoremap J :bprevious +nnoremap K :bnext + +" Window navigation +nnoremap h +nnoremap j +nnoremap k +nnoremap l + +" Use alt +hjkl to resize windows +nnoremap :vertical resize -2 +nnoremap :resize -2 +nnoremap :resize +2 +nnoremap :vertical resize +2 + +" Remap escape +inoremap jkl +inoremap JKL + +" Tab changes buffer +nnoremap :bnext +nnoremap :bprevious + +" Sane Y default +nnoremap Y y$ + +" add a semicolon +inoremap A; +nnoremap A; + +" add a comma +inoremap A, +nnoremap A, + +" add 3 ` +inoremap ``` + +" add brackets +inoremap A() +nnoremap A() + +inoremap A[] +nnoremap A[] + +inoremap A{} +nnoremap A{} + +" Move while in insert mode +inoremap +inoremap +inoremap +inoremap + +inoremap +inoremap +inoremap +inoremap + +" Re-source vim +nnoremap :source ~/.config/nvim/init.vim diff --git a/nvim_0-4-4/vim_settings/plugins.vim b/nvim_0-4-4/vim_settings/plugins.vim new file mode 100644 index 0000000..94b8241 --- /dev/null +++ b/nvim_0-4-4/vim_settings/plugins.vim @@ -0,0 +1,94 @@ +" Auto-install vim-plug +if empty(glob('$HOME/.local/share/nvim/site/autoload/plug.vim')) + silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim +endif + +" Plugin List +call plug#begin() + + " Coc + Plug 'neoclide/coc.nvim', {'branch': 'release'} + + " nerdtree + Plug 'preservim/nerdtree' + Plug 'ryanoasis/vim-devicons' + Plug 'tiagofumo/vim-nerdtree-syntax-highlight' + Plug 'Xuyuanp/nerdtree-git-plugin' + Plug 'PhilRunninger/nerdtree-visual-selection' + + " Bar + Plug 'vim-airline/vim-airline' + Plug 'vim-airline/vim-airline-themes' + + " Auto pairs for '(' '[' '{' + Plug 'jiangmiao/auto-pairs' + + " Surround with '(' '[' '{' + Plug 'tpope/vim-surround' + + " Highlight for scope f and F + Plug 'unblevable/quick-scope' + + " Mass comment / uncomment + Plug 'tpope/vim-commentary' + + " Floaterm + Plug 'voldikss/vim-floaterm' + + " Startify + Plug 'mhinz/vim-startify' + + " Signify --- Git + if has('nvim') || has('patch-8.0.902') + Plug 'mhinz/vim-signify' + else + Plug 'mhinz/vim-signify', { 'branch': 'legacy' } + endif + + " Fugitive --- Git + Plug 'tpope/vim-fugitive' + + " Themes + " PaperColor + Plug 'NLKNguyen/papercolor-theme' + + " Pop-punk + Plug 'bignimbus/pop-punk.vim' + + " Jinja Support + Plug 'lepture/vim-jinja' + + " For Python f string highlighting + Plug 'sheerun/vim-polyglot' + + " Assembly + Plug 'Shirk/vim-gas' + +call plug#end() + +" Coc List +let g:coc_global_extensions = [ + \ 'coc-clangd', + \ 'coc-clang-format-style-options', + \ 'coc-cmake', + \ 'coc-css', + \ 'coc-cssmodules', + \ 'coc-diagnostic', + \ 'coc-docker', + \ 'coc-json', + \ 'coc-go', + \ 'coc-highlight', + \ 'coc-html', + \ 'coc-htmldjango', + \ 'coc-html-css-support', + \ 'coc-jedi', + \ 'coc-json', + \ 'coc-markdownlint', + \ '@yaegassy/coc-nginx', + \ 'coc-rls', + \ 'coc-toml', + \ 'coc-tsserver', + \ 'coc-xml', + \ 'coc-yaml', +\] diff --git a/nvim_0-4-4/vim_settings/settings.vim b/nvim_0-4-4/vim_settings/settings.vim new file mode 100644 index 0000000..237dfc0 --- /dev/null +++ b/nvim_0-4-4/vim_settings/settings.vim @@ -0,0 +1,46 @@ +syntax enable + +set encoding=utf-8 +set fileencoding=utf-8 + +set mouse=a + +set shiftwidth=4 +set smarttab +set expandtab +set smartindent +set autoindent + +set colorcolumn=88 +set nowrap +set linebreak +augroup Markdown + autocmd! + autocmd FileType markdown set wrap +augroup END +set number relativenumber +set hidden +set nohlsearch +set guicursor=i:block + +au BufEnter * set fo-=c +au BufEnter * set fo-=o + +set clipboard=unnamedplus + +set termguicolors + +set nobackup +set nowritebackup +set updatetime=500 +set shortmess+=c + +augroup FileJinjaType + autocmd! + autocmd BufNewFile,BufRead *.html :set filetype=jinja.html +augroup END + +augroup Format + autocmd! + autocmd BufWritePre *.html :normal mZgg=G`Z:delmarks Z +augroup END diff --git a/plug_settings/autopairs/settings.vim b/plug_settings/autopairs/settings.vim deleted file mode 100644 index 93edb3f..0000000 --- a/plug_settings/autopairs/settings.vim +++ /dev/null @@ -1 +0,0 @@ -au FileType jinja.html let b:AutoPairs = AutoPairsDefine({'{%' : '%}'}) diff --git a/plug_settings/coc/mappings.vim b/plug_settings/coc/mappings.vim deleted file mode 100644 index b1b0412..0000000 --- a/plug_settings/coc/mappings.vim +++ /dev/null @@ -1,45 +0,0 @@ -" Coc Mappings - -" Use `[g` and `]g` to navigate diagnostics -" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. -nmap [g (coc-diagnostic-prev) -nmap ]g (coc-diagnostic-next) - -" GoTo code navigation. -nmap gd (coc-definition) -nmap gy (coc-type-definition) -nmap gi (coc-implementation) -nmap gr (coc-references) - -" Formatting selected code -xmap f (coc-format-selected) -nmap f (coc-format-selected) - -augroup mygroup - autocmd! - " Setup formatexpr specified filetype(s). - autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') - " Update signature help on jump placeholder. - autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') -augroup end - -" Symbol renaming -nnoremap rn (coc-rename) - -" Use tab for trigger completion with characters ahead and navigate. -" NOTE: Use command ':verbose imap ' to make sure tab is not mapped by -" other plugin before putting this into your config. -inoremap - \ pumvisible() ? "\" : - \ CheckBackspace() ? "\" : - \ coc#refresh() -inoremap pumvisible() ? "\" : "\" - -function! CheckBackspace() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' -endfunction - -" Use to trigger completion -inoremap pumvisible() ? "" : "\r" - diff --git a/plug_settings/coc/settings.vim b/plug_settings/coc/settings.vim deleted file mode 100644 index 197c585..0000000 --- a/plug_settings/coc/settings.vim +++ /dev/null @@ -1,3 +0,0 @@ -" Highlight the symbol and its references when holding the cursor -autocmd CursorHold * silent call CocActionAsync('highlight') - diff --git a/plug_settings/floaterm/mappings.vim b/plug_settings/floaterm/mappings.vim deleted file mode 100644 index 98d895e..0000000 --- a/plug_settings/floaterm/mappings.vim +++ /dev/null @@ -1,6 +0,0 @@ -" Floaterm -let g:floaterm_keymap_toggle = '' -let g:floaterm_keymap_prev = '' -let g:floaterm_keymap_next = '' -let g:floaterm_keymap_new = '' -let g:floaterm_keymap_kill = '' diff --git a/plug_settings/nerdtree/mappings.vim b/plug_settings/nerdtree/mappings.vim deleted file mode 100644 index bf92ab9..0000000 --- a/plug_settings/nerdtree/mappings.vim +++ /dev/null @@ -1,3 +0,0 @@ -nnoremap n :NERDTree -nnoremap e :NERDTreeToggle -nnoremap f :NERDTreeFocus diff --git a/plug_settings/nerdtree/settings.vim b/plug_settings/nerdtree/settings.vim deleted file mode 100644 index e02692f..0000000 --- a/plug_settings/nerdtree/settings.vim +++ /dev/null @@ -1,22 +0,0 @@ -let g:NERDTreeGitStatusUseNerdFonts = 1 -let g:NERDTreeHighlightCursorline = 0 -let g:NERDTreeShowHidden = 0 - -let g:NERDTreeIgnore = [ - \ '__pycache__', - \ '.\.so', - \ 'build', - \ 'develop-eggs', - \ 'dist', - \ 'downloads', - \ 'eggs', - \ '.\.egg-info', - \ '__pypackages__', - \ '\.env', - \ '\.venv', - \ 'env', - \ 'venv', - \ 'ENV', - \ 'env\.bak', - \ 'venv\.bak' -\] diff --git a/plug_settings/scope/settings.vim b/plug_settings/scope/settings.vim deleted file mode 100644 index d80951e..0000000 --- a/plug_settings/scope/settings.vim +++ /dev/null @@ -1,5 +0,0 @@ -augroup qs_colors - autocmd! - autocmd ColorScheme * highlight QuickScopePrimary guifg='#ff00ff' gui=underline ctermfg=155 cterm=underline - autocmd ColorScheme * highlight QuickScopeSecondary guifg='#aa0000' gui=underline ctermfg=81 cterm=underline -augroup END diff --git a/plug_settings/startify/settings.vim b/plug_settings/startify/settings.vim deleted file mode 100644 index 5cb5ae1..0000000 --- a/plug_settings/startify/settings.vim +++ /dev/null @@ -1,38 +0,0 @@ -let g:startify_session_dir = '~/.config/nvim/session' - -let g:startify_lists = [ - \ { 'type': 'files', 'header': [' Files'] }, - \ { 'type': 'dir', 'header': [' Current Directory '. getcwd()] }, - \ { 'type': 'sessions', 'header': [' Sessions'] }, - \ { 'type': 'bookmarks', 'header': [' Bookmarks'] }, - \ ] - -let g:startify_bookmarks = [ - \ { 'in': '~/.config/nvim/init.vim' }, - \ { 'b': '~/.bashrc' } - \ ] - -" You can automatically restart a session like this -let g:startify_session_autoload = 1 - -let g:startify_change_to_dir = 1 - -let g:startify_session_delete_buffers = 1 - -let g:startify_change_to_vcs_root = 1 - -let g:startify_fortune_use_unicode = 1 - -let g:startify_session_persistence = 1 - -let g:startify_enable_special = 0 - -let g:startify_custom_header = [ - \ ' __ __ _ ___ ', - \ ' \ \/ /___ _______ ______ ____ | | / (_)___ ___ ', - \ ' \ / __ \/ ___/ / / / __ `/ __ \ | | / / / __ `__ \', - \ ' / / /_/ / / / /_/ / /_/ / /_/ / | |/ / / / / / / /', - \ ' /_/\____/_/ \__,_/\__, /\____/ |___/_/_/ /_/ /_/ ', - \ ' /____/ ', - \] - diff --git a/plug_settings/theme/airline.vim b/plug_settings/theme/airline.vim deleted file mode 100644 index 2991bab..0000000 --- a/plug_settings/theme/airline.vim +++ /dev/null @@ -1,5 +0,0 @@ -let g:airline_powerline_fonts = 1 -let g:airline#extensions#tabline#enabled = 1 -let g:airline#extensions#branch#enabled = 1 - -let g:airline_section_z = '%3p%% %3l:%2c' diff --git a/plug_settings/theme/color.vim b/plug_settings/theme/color.vim deleted file mode 100644 index 973ad9f..0000000 --- a/plug_settings/theme/color.vim +++ /dev/null @@ -1,3 +0,0 @@ -set background=dark -colo pop-punk -let g:airline_theme='pop_punk' diff --git a/vim_settings/mappings.vim b/vim_settings/mappings.vim deleted file mode 100644 index 3ed4d0a..0000000 --- a/vim_settings/mappings.vim +++ /dev/null @@ -1,66 +0,0 @@ -" Autocomplete navigation -inoremap ("\") -inoremap ("\") -inoremap ("\a") - -" Buffer navigation -nnoremap J :bprevious -nnoremap K :bnext - -" Window navigation -nnoremap h -nnoremap j -nnoremap k -nnoremap l - -" Use alt +hjkl to resize windows -nnoremap :vertical resize -2 -nnoremap :resize -2 -nnoremap :resize +2 -nnoremap :vertical resize +2 - -" Remap escape -inoremap jkl -inoremap JKL - -" Tab changes buffer -nnoremap :bnext -nnoremap :bprevious - -" Sane Y default -nnoremap Y y$ - -" add a semicolon -inoremap A; -nnoremap A; - -" add a comma -inoremap A, -nnoremap A, - -" add 3 ` -inoremap ``` - -" add brackets -inoremap A() -nnoremap A() - -inoremap A[] -nnoremap A[] - -inoremap A{} -nnoremap A{} - -" Move while in insert mode -inoremap -inoremap -inoremap -inoremap - -inoremap -inoremap -inoremap -inoremap - -" Re-source vim -inoremap :source ~/.config/nvim/init.vim diff --git a/vim_settings/plugins.vim b/vim_settings/plugins.vim deleted file mode 100644 index 10ae31f..0000000 --- a/vim_settings/plugins.vim +++ /dev/null @@ -1,91 +0,0 @@ -" Auto-install vim-plug -if empty(glob('$HOME/.local/share/nvim/site/autoload/plug.vim')) - silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs - \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim -endif - -" Plugin List -call plug#begin() - - " Coc - Plug 'neoclide/coc.nvim', {'branch': 'release'} - - " nerdtree - Plug 'preservim/nerdtree' - Plug 'ryanoasis/vim-devicons' - Plug 'tiagofumo/vim-nerdtree-syntax-highlight' - Plug 'Xuyuanp/nerdtree-git-plugin' - Plug 'PhilRunninger/nerdtree-visual-selection' - - " Bar - Plug 'vim-airline/vim-airline' - Plug 'vim-airline/vim-airline-themes' - - " Auto pairs for '(' '[' '{' - Plug 'jiangmiao/auto-pairs' - - " Surround with '(' '[' '{' - Plug 'tpope/vim-surround' - - " Highlight for scope f and F - Plug 'unblevable/quick-scope' - - " Mass comment / uncomment - Plug 'tpope/vim-commentary' - - " Floaterm - Plug 'voldikss/vim-floaterm' - - " Startify - Plug 'mhinz/vim-startify' - - " Signify --- Git - if has('nvim') || has('patch-8.0.902') - Plug 'mhinz/vim-signify' - else - Plug 'mhinz/vim-signify', { 'branch': 'legacy' } - endif - - " Fugitive --- Git - Plug 'tpope/vim-fugitive' - - " Themes - " PaperColor - Plug 'NLKNguyen/papercolor-theme' - - " Pop-punk - Plug 'bignimbus/pop-punk.vim' - - " Jinja Support - Plug 'lepture/vim-jinja' - - " For Python f string highlighting - Plug 'sheerun/vim-polyglot' - -call plug#end() - -" Coc List -let g:coc_global_extensions = [ - \ 'coc-clangd', - \ 'coc-clang-format-style-options', - \ 'coc-cmake', - \ 'coc-css', - \ 'coc-cssmodules', - \ 'coc-diagnostic', - \ 'coc-docker', - \ 'coc-json', - \ 'coc-go', - \ 'coc-highlight', - \ 'coc-html', - \ 'coc-htmldjango', - \ 'coc-html-css-support', - \ 'coc-jedi', - \ 'coc-json', - \ 'coc-markdownlint', - \ '@yaegassy/coc-nginx', - \ 'coc-rls', - \ 'coc-toml', - \ 'coc-tsserver', - \ 'coc-xml', - \ 'coc-yaml', -\] diff --git a/vim_settings/settings.vim b/vim_settings/settings.vim deleted file mode 100644 index 4751330..0000000 --- a/vim_settings/settings.vim +++ /dev/null @@ -1,45 +0,0 @@ -syntax enable - -set encoding=utf-8 -set fileencoding=utf-8 - -set mouse=a - -set shiftwidth=4 -set smarttab -set expandtab -set smartindent -set autoindent - -set colorcolumn=88 -set nowrap -set linebreak -augroup Markdown - autocmd! - autocmd FileType markdown set wrap -augroup END -set number relativenumber -set hidden -set nohlsearch - -au BufEnter * set fo-=c -au BufEnter * set fo-=o - -set clipboard=unnamedplus - -set termguicolors - -set nobackup -set nowritebackup -set updatetime=200 -set shortmess+=c - -augroup FileJinjaType - autocmd! - autocmd BufNewFile,BufRead *.html :set filetype=jinja.html -augroup END - -augroup Format - autocmd! - autocmd BufWritePre *.html :normal mZgg=G`Z:delmarks Z -augroup END