diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | after/plugin/colors.lua | 9 | ||||
-rw-r--r-- | after/plugin/lsp.lua | 120 | ||||
-rw-r--r-- | after/plugin/telescope.lua | 6 | ||||
-rw-r--r-- | after/plugin/treesitter.lua | 21 | ||||
-rw-r--r-- | colors/wal.vim | 196 | ||||
-rw-r--r-- | init.lua | 53 | ||||
-rw-r--r-- | lua/wozniak/config.lua | 18 | ||||
-rw-r--r-- | lua/wozniak/init.lua | 3 | ||||
-rw-r--r-- | lua/wozniak/remap.lua | 0 | ||||
-rw-r--r-- | lua/wozniak/remaps.lua | 2 |
11 files changed, 102 insertions, 328 deletions
@@ -1 +1 @@ -plugin/packer_compiled.lua +lazy-lock.json diff --git a/after/plugin/colors.lua b/after/plugin/colors.lua deleted file mode 100644 index 7c7bd0f..0000000 --- a/after/plugin/colors.lua +++ /dev/null @@ -1,9 +0,0 @@ -function ColorMyPencils(color) - color = color or 'wal' - vim.cmd.colorscheme(color) - vim.api.nvim_set_hl(0, "Normal", { bg = 'none'}) - vim.api.nvim_set_hl(0, "NormalFloat", { bg = 'none'}) - vim.api.nvim_set_hl(0, "EndOfBuffer", { bg = 'none'}) -end - -ColorMyPencils() diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index cfb10e8..7722c1e 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -1,59 +1,81 @@ -local lsp = require("lsp-zero") +-- Setup autocomplete/LSP clients +local lspconfig = require('lspconfig') +local lsp_capabilities = require('cmp_nvim_lsp').default_capabilities() -lsp.preset("recommended") +local servers = {"clangd", "zls", "rust_analyzer", "lua_ls"} + for _, lsp in pairs(servers) do + lspconfig[lsp].setup { + capabilities = lsp_capabilities, + on_attach = onattach, + flags = {debounce_text_changes = 500} + } +end -lsp.setup_servers({ - 'clangd', - 'rust_analyzer', - 'lua_ls', -}) +vim.api.nvim_create_autocmd('LspAttach', { + desc = 'LSP actions', + callback = function() + local bufmap = function(mode, lhs, rhs) + local opts = {buffer = true} + vim.keymap.set(mode, lhs, rhs, opts) + end --- Fix Undefined global 'vim' -lsp.nvim_workspace() + bufmap('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>') + bufmap('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>') + bufmap('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>') + bufmap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>') + bufmap('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>') + bufmap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>') + bufmap('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>') + bufmap('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>') + bufmap('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>') + bufmap('n', 'gl', '<cmd>lua vim.diagnostic.open_float()<cr>') + bufmap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<cr>') + bufmap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<cr>') + end +}) +require('luasnip.loaders.from_vscode').lazy_load() local cmp = require('cmp') -local cmp_select = {behavior = cmp.SelectBehavior.Select} -local cmp_mappings = lsp.defaults.cmp_mappings({ - ['<C-p>'] = cmp.mapping.select_prev_item(cmp_select), - ['<C-n>'] = cmp.mapping.select_next_item(cmp_select), - ['<C-y>'] = cmp.mapping.confirm({ select = true }), - ["<C-Space>"] = cmp.mapping.complete(), -}) +local luasnip = require('luasnip') -cmp_mappings['<Tab>'] = nil -cmp_mappings['<S-Tab>'] = nil +local select_opts = {behavior = cmp.SelectBehavior.Select} +cmp.setup({ + formatting = { + fields = {'menu', 'abbr', 'kind'}, + format = function(entry, item) + local menu_icon = { + nvim_lsp = 'λ', + luasnip = '⋗', + buffer = 'Ω', + path = '🖫', + } + item.menu = menu_icon[entry.source.name] + return item + end, + }, + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end + }, + sources = { + {name = 'path'}, + {name = 'nvim_lsp', keyword_length = 1}, + {name = 'buffer', keyword_length = 3}, + {name = 'luasnip', keyword_length = 2}, + }, + mapping = { + ['<Up>'] = cmp.mapping.select_prev_item(select_opts), + ['<Down>'] = cmp.mapping.select_next_item(select_opts), -lsp.setup_nvim_cmp({ - mapping = cmp_mappings -}) + ['<C-p>'] = cmp.mapping.select_prev_item(select_opts), + ['<C-n>'] = cmp.mapping.select_next_item(select_opts), -lsp.set_preferences({ - suggest_lsp_servers = false, - sign_icons = { - error = 'E', - warn = 'W', - hint = 'H', - info = 'I' - } -}) + ['<C-u>'] = cmp.mapping.scroll_docs(-4), + ['<C-d>'] = cmp.mapping.scroll_docs(4), -lsp.on_attach(function(client, bufnr) - local opts = {buffer = bufnr, remap = false} - - vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) - vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) - vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts) - vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts) - vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) - vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) - vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts) - vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts) - vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts) - vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts) -end) - -lsp.setup() - -vim.diagnostic.config({ - virtual_text = true + ['<C-e>'] = cmp.mapping.abort(), + ['<C-y>'] = cmp.mapping.confirm({select = true}), + ['<CR>'] = cmp.mapping.confirm({select = false}), + }, }) diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua index 8dae86b..7eeb0a1 100644 --- a/after/plugin/telescope.lua +++ b/after/plugin/telescope.lua @@ -1,4 +1,4 @@ -local builtin = require('telescope.builtin') +local builtin = require "telescope.builtin" vim.keymap.set('n', '<leader>pf', builtin.find_files, {}) -vim.keymap.set('n', '<C-p>', builtin.git_files, {}) -vim.keymap.set('n', '<C-g>', builtin.live_grep, {}) +vim.keymap.set('n', '<leader>fg', builtin.live_grep, {}) +vim.keymap.set('n', '<leader>ff', builtin.buffers, {}) diff --git a/after/plugin/treesitter.lua b/after/plugin/treesitter.lua deleted file mode 100644 index 86826a0..0000000 --- a/after/plugin/treesitter.lua +++ /dev/null @@ -1,21 +0,0 @@ -require'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" (the five listed parsers should always be installed) - ensure_installed = { "zig", "rust", "c", "lua", "vim", "vimdoc", "query" }, - - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, - - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, - - highlight = { - enable = true, - - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = false, - }, -} diff --git a/colors/wal.vim b/colors/wal.vim deleted file mode 100644 index 4b6c5d4..0000000 --- a/colors/wal.vim +++ /dev/null @@ -1,196 +0,0 @@ -" wal.vim -- Vim color scheme. -" Author: Dylan Araps -" Webpage: https://github.com/dylanaraps/wal -" Description: A colorscheme that uses your terminal colors, made to work with 'wal'. - -hi clear -set background=dark - -if exists('syntax_on') - syntax reset -endif - -" Colorscheme name -let g:colors_name = 'wal' - -" highlight groups {{{ - -" set t_Co=16 -hi Normal ctermbg=NONE ctermfg=7 -hi NonText ctermbg=NONE ctermfg=0 -hi Comment ctermbg=NONE ctermfg=8 -hi Conceal ctermbg=NONE -hi Constant ctermbg=NONE ctermfg=3 -hi Error ctermbg=1 ctermfg=7 -hi Identifier ctermbg=NONE ctermfg=1 cterm=BOLD -hi Ignore ctermbg=8 ctermfg=0 -hi PreProc ctermbg=NONE ctermfg=3 -hi Special ctermbg=NONE ctermfg=6 -hi Statement ctermbg=NONE ctermfg=1 -hi String ctermbg=NONE ctermfg=2 -hi Number ctermbg=NONE ctermfg=3 -hi Todo ctermbg=2 ctermfg=0 -hi Type ctermbg=NONE ctermfg=3 -hi Underlined ctermbg=NONE ctermfg=1 cterm=underline -hi StatusLine ctermbg=7 ctermfg=0 -hi StatusLineNC ctermbg=8 ctermfg=0 -hi TabLine ctermbg=NONE ctermfg=8 -hi TabLineFill ctermbg=NONE ctermfg=8 -hi TabLineSel ctermbg=4 ctermfg=0 -hi TermCursorNC ctermbg=3 ctermfg=0 -hi VertSplit ctermbg=8 ctermfg=0 -hi Title ctermbg=NONE ctermfg=4 -hi CursorLine ctermbg=2 ctermfg=0 -hi LineNr ctermbg=NONE ctermfg=8 -hi CursorLineNr ctermbg=NONE ctermfg=8 -hi helpLeadBlank ctermbg=NONE ctermfg=7 -hi helpNormal ctermbg=NONE ctermfg=7 -hi Visual ctermbg=0 ctermfg=15 cterm=reverse term=reverse -hi VisualNOS ctermbg=NONE ctermfg=1 -hi Pmenu ctermbg=8 ctermfg=7 -hi PmenuSbar ctermbg=6 ctermfg=7 -hi PmenuSel ctermbg=4 ctermfg=0 -hi PmenuThumb ctermbg=8 ctermfg=8 -hi FoldColumn ctermbg=NONE ctermfg=7 -hi Folded ctermbg=NONE ctermfg=8 -hi WildMenu ctermbg=2 ctermfg=0 -hi SpecialKey ctermbg=NONE ctermfg=8 -hi DiffAdd ctermbg=NONE ctermfg=2 -hi DiffChange ctermbg=NONE ctermfg=8 -hi DiffDelete ctermbg=NONE ctermfg=1 -hi DiffText ctermbg=NONE ctermfg=4 -hi IncSearch ctermbg=3 ctermfg=0 -hi Search ctermbg=3 ctermfg=0 -hi Directory ctermbg=NONE ctermfg=4 -hi MatchParen ctermbg=1 ctermfg=8 -hi ColorColumn ctermbg=4 ctermfg=0 -hi signColumn ctermbg=NONE ctermfg=4 -hi ErrorMsg ctermbg=NONE ctermfg=8 -hi ModeMsg ctermbg=NONE ctermfg=2 -hi MoreMsg ctermbg=NONE ctermfg=2 -hi Question ctermbg=NONE ctermfg=4 -hi WarningMsg ctermbg=1 ctermfg=0 -hi Cursor ctermbg=NONE ctermfg=8 -hi Structure ctermbg=NONE ctermfg=5 -hi CursorColumn ctermbg=8 ctermfg=7 -hi ModeMsg ctermbg=NONE ctermfg=7 -hi SpellBad ctermbg=NONE ctermfg=1 cterm=underline -hi SpellCap ctermbg=NONE ctermfg=4 cterm=underline -hi SpellLocal ctermbg=NONE ctermfg=5 cterm=underline -hi SpellRare ctermbg=NONE ctermfg=6 cterm=underline -hi Boolean ctermbg=NONE ctermfg=5 -hi Character ctermbg=NONE ctermfg=1 -hi Conditional ctermbg=NONE ctermfg=5 -hi Define ctermbg=NONE ctermfg=5 -hi Delimiter ctermbg=NONE ctermfg=5 -hi Float ctermbg=NONE ctermfg=5 -hi Include ctermbg=NONE ctermfg=4 -hi Keyword ctermbg=NONE ctermfg=5 -hi Label ctermbg=NONE ctermfg=3 -hi Operator ctermbg=NONE ctermfg=7 -hi Repeat ctermbg=NONE ctermfg=3 -hi SpecialChar ctermbg=NONE ctermfg=5 -hi Tag ctermbg=NONE ctermfg=3 -hi Typedef ctermbg=NONE ctermfg=3 -hi vimUserCommand ctermbg=NONE ctermfg=1 cterm=BOLD - hi link vimMap vimUserCommand - hi link vimLet vimUserCommand - hi link vimCommand vimUserCommand - hi link vimFTCmd vimUserCommand - hi link vimAutoCmd vimUserCommand - hi link vimNotFunc vimUserCommand -hi vimNotation ctermbg=NONE ctermfg=4 -hi vimMapModKey ctermbg=NONE ctermfg=4 -hi vimBracket ctermbg=NONE ctermfg=7 -hi vimCommentString ctermbg=NONE ctermfg=8 -hi htmlLink ctermbg=NONE ctermfg=1 cterm=underline -hi htmlBold ctermbg=NONE ctermfg=3 cterm=BOLD -hi htmlItalic ctermbg=NONE ctermfg=5 -hi htmlEndTag ctermbg=NONE ctermfg=7 -hi htmlTag ctermbg=NONE ctermfg=7 -hi htmlTagName ctermbg=NONE ctermfg=1 cterm=BOLD -hi htmlH1 ctermbg=NONE ctermfg=7 - hi link htmlH2 htmlH1 - hi link htmlH3 htmlH1 - hi link htmlH4 htmlH1 - hi link htmlH5 htmlH1 - hi link htmlH6 htmlH1 -hi cssMultiColumnAttr ctermbg=NONE ctermfg=2 - hi link cssFontAttr cssMultiColumnAttr - hi link cssFlexibleBoxAttr cssMultiColumnAttr -hi cssBraces ctermbg=NONE ctermfg=7 - hi link cssAttrComma cssBraces -hi cssValueLength ctermbg=NONE ctermfg=7 -hi cssUnitDecorators ctermbg=NONE ctermfg=7 -hi cssValueNumber ctermbg=NONE ctermfg=7 - hi link cssValueLength cssValueNumber -hi cssNoise ctermbg=NONE ctermfg=8 -hi cssTagName ctermbg=NONE ctermfg=1 -hi cssFunctionName ctermbg=NONE ctermfg=4 -hi scssSelectorChar ctermbg=NONE ctermfg=7 -hi scssAttribute ctermbg=NONE ctermfg=7 - hi link scssDefinition cssNoise -hi sassidChar ctermbg=NONE ctermfg=1 -hi sassClassChar ctermbg=NONE ctermfg=5 -hi sassInclude ctermbg=NONE ctermfg=5 -hi sassMixing ctermbg=NONE ctermfg=5 -hi sassMixinName ctermbg=NONE ctermfg=4 -hi javaScript ctermbg=NONE ctermfg=7 -hi javaScriptBraces ctermbg=NONE ctermfg=7 -hi javaScriptNumber ctermbg=NONE ctermfg=5 -hi markdownH1 ctermbg=NONE ctermfg=7 - hi link markdownH2 markdownH1 - hi link markdownH3 markdownH1 - hi link markdownH4 markdownH1 - hi link markdownH5 markdownH1 - hi link markdownH6 markdownH1 -hi markdownAutomaticLink ctermbg=NONE ctermfg=2 cterm=underline - hi link markdownUrl markdownAutomaticLink -hi markdownError ctermbg=NONE ctermfg=7 -hi markdownCode ctermbg=NONE ctermfg=3 -hi markdownCodeBlock ctermbg=NONE ctermfg=3 -hi markdownCodeDelimiter ctermbg=NONE ctermfg=5 -hi markdownItalic cterm=Italic -hi markdownBold cterm=Bold -hi xdefaultsValue ctermbg=NONE ctermfg=7 -hi rubyInclude ctermbg=NONE ctermfg=4 -hi rubyDefine ctermbg=NONE ctermfg=5 -hi rubyFunction ctermbg=NONE ctermfg=4 -hi rubyStringDelimiter ctermbg=NONE ctermfg=2 -hi rubyInteger ctermbg=NONE ctermfg=3 -hi rubyAttribute ctermbg=NONE ctermfg=4 -hi rubyConstant ctermbg=NONE ctermfg=3 -hi rubyInterpolation ctermbg=NONE ctermfg=2 -hi rubyInterpolationDelimiter ctermbg=NONE ctermfg=3 -hi rubyRegexp ctermbg=NONE ctermfg=6 -hi rubySymbol ctermbg=NONE ctermfg=2 -hi rubyTodo ctermbg=NONE ctermfg=8 -hi rubyRegexpAnchor ctermbg=NONE ctermfg=7 - hi link rubyRegexpQuantifier rubyRegexpAnchor -hi pythonOperator ctermbg=NONE ctermfg=5 -hi pythonFunction ctermbg=NONE ctermfg=4 -hi pythonRepeat ctermbg=NONE ctermfg=5 -hi pythonStatement ctermbg=NONE ctermfg=1 cterm=Bold -hi pythonBuiltIn ctermbg=NONE ctermfg=4 -hi phpMemberSelector ctermbg=NONE ctermfg=7 -hi phpComparison ctermbg=NONE ctermfg=7 -hi phpParent ctermbg=NONE ctermfg=7 -hi cOperator ctermbg=NONE ctermfg=6 -hi cPreCondit ctermbg=NONE ctermfg=5 -hi SignifySignAdd ctermbg=NONE ctermfg=2 -hi SignifySignChange ctermbg=NONE ctermfg=4 -hi SignifySignDelete ctermbg=NONE ctermfg=1 -hi NERDTreeDirSlash ctermbg=NONE ctermfg=4 -hi NERDTreeExecFile ctermbg=NONE ctermfg=7 -hi ALEErrorSign ctermbg=NONE ctermfg=1 -hi ALEWarningSign ctermbg=NONE ctermfg=3 -hi ALEError ctermbg=NONE ctermfg=1 -hi ALEWarning ctermbg=NONE ctermfg=3 - -" }}} - -" Plugin options {{{ - -let g:limelight_conceal_ctermfg = 8 - -" }}} @@ -1,27 +1,28 @@ -require('wozniak') +-- Install lazy.nvim on new systems +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) -vim.cmd [[packadd packer.nvim]] - -return require('packer').startup(function(use) - -- Packer can manage itself - use 'wbthomason/packer.nvim' - use { - 'nvim-telescope/telescope.nvim', tag = '0.1.1', - -- or , branch = '0.1.x', - requires = { {'nvim-lua/plenary.nvim'} } - } - use { 'nvim-treesitter/nvim-treesitter', run = {':TSUpdate' } } - use { - 'VonHeikemen/lsp-zero.nvim', - branch = 'v2.x', - requires = { - -- LSP Support - {'neovim/nvim-lspconfig'}, -- Required - - -- Autocompletion - {'hrsh7th/nvim-cmp'}, -- Required - {'hrsh7th/cmp-nvim-lsp'}, -- Required - {'L3MON4D3/LuaSnip'}, -- Required - } - } -end) +-- Plugin manager +require("lazy").setup({ + "junegunn/seoul256.vim", + "neovim/nvim-lspconfig", + "hrsh7th/nvim-cmp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "saadparwaiz1/cmp_luasnip", + "hrsh7th/cmp-nvim-lsp", + "L3MON4D3/LuaSnip", + "rafamadriz/friendly-snippets", + {"nvim-telescope/telescope.nvim", dependencies = {"nvim-lua/plenary.nvim"}}, + "nvim-lualine/lualine.nvim", +}) diff --git a/lua/wozniak/config.lua b/lua/wozniak/config.lua deleted file mode 100644 index f2b999b..0000000 --- a/lua/wozniak/config.lua +++ /dev/null @@ -1,18 +0,0 @@ -vim.opt.nu = true - -vim.opt.tabstop = 4 -vim.opt.softtabstop = 4 -vim.opt.shiftwidth = 4 -vim.opt.expandtab = false -vim.opt.wrap = false - -vim.opt.hlsearch = false -vim.opt.incsearch = true - --- vim.opt.termguicolors = true - -vim.opt.scrolloff = 8 - -vim.opt.updatetime = 50 - -vim.g.mapleader = ' ' diff --git a/lua/wozniak/init.lua b/lua/wozniak/init.lua deleted file mode 100644 index 1bfb2d7..0000000 --- a/lua/wozniak/init.lua +++ /dev/null @@ -1,3 +0,0 @@ -require('wozniak.remaps') -require('wozniak.config') -require('wozniak.remap') diff --git a/lua/wozniak/remap.lua b/lua/wozniak/remap.lua deleted file mode 100644 index e69de29..0000000 --- a/lua/wozniak/remap.lua +++ /dev/null diff --git a/lua/wozniak/remaps.lua b/lua/wozniak/remaps.lua deleted file mode 100644 index 610cc58..0000000 --- a/lua/wozniak/remaps.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.g.mapleader = ' ' -vim.keymap.set('n', '<leader>pv', vim.cmd.Ex) |