summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Matthew Wozniak <sirtomato999@gmail.com> 2023-06-28 10:10:19 -0400
committerGravatar Matthew Wozniak <sirtomato999@gmail.com> 2023-06-28 10:10:19 -0400
commit991b90da98ad3f1da30dcb58c6f835bef9124097 (patch)
treec816e4ccc285fc44980f1137b58a37b5842fb20d
downloadnvim-991b90da98ad3f1da30dcb58c6f835bef9124097.tar.gz
nvim-991b90da98ad3f1da30dcb58c6f835bef9124097.zip
new config
-rw-r--r--.gitignore1
-rw-r--r--.gitmodules3
-rw-r--r--after/plugin/colors.lua9
-rw-r--r--after/plugin/lsp.lua60
-rw-r--r--after/plugin/lualine.lua9
-rw-r--r--after/plugin/telescope.lua4
-rw-r--r--after/plugin/treesitter.lua21
-rw-r--r--init.lua37
-rw-r--r--lua/wozniak/config.lua18
-rw-r--r--lua/wozniak/init.lua3
-rw-r--r--lua/wozniak/remap.lua0
-rw-r--r--lua/wozniak/remaps.lua2
m---------site/pack/packer/start/packer.nvim0
13 files changed, 167 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..c84aa4a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+plugin/packer_compiled.lua
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..7467f4b
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "site/pack/packer/start/packer.nvim"]
+ path = site/pack/packer/start/packer.nvim
+ url = https://github.com/wbthomason/packer.nvim
diff --git a/after/plugin/colors.lua b/after/plugin/colors.lua
new file mode 100644
index 0000000..54f0a12
--- /dev/null
+++ b/after/plugin/colors.lua
@@ -0,0 +1,9 @@
+function ColorMyPencils(color)
+ color = color or 'OceanicNext'
+ 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
new file mode 100644
index 0000000..dfcf7ea
--- /dev/null
+++ b/after/plugin/lsp.lua
@@ -0,0 +1,60 @@
+local lsp = require("lsp-zero")
+
+lsp.preset("recommended")
+
+lsp.ensure_installed({
+ 'clangd',
+ 'rust_analyzer',
+ 'lua_ls',
+})
+
+-- Fix Undefined global 'vim'
+lsp.nvim_workspace()
+
+
+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(),
+})
+
+cmp_mappings['<Tab>'] = nil
+cmp_mappings['<S-Tab>'] = nil
+
+lsp.setup_nvim_cmp({
+ mapping = cmp_mappings
+})
+
+lsp.set_preferences({
+ suggest_lsp_servers = false,
+ sign_icons = {
+ error = 'E',
+ warn = 'W',
+ hint = 'H',
+ info = 'I'
+ }
+})
+
+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
+})
diff --git a/after/plugin/lualine.lua b/after/plugin/lualine.lua
new file mode 100644
index 0000000..9c8b1b7
--- /dev/null
+++ b/after/plugin/lualine.lua
@@ -0,0 +1,9 @@
+require('lualine').setup {
+ options = {
+ icons_enabled = false,
+ component_seperators = { left = '', right = '' },
+ section_seperators = { left = '', right = '' },
+ }
+}
+
+vim.cmd [[set noshowmode]]
diff --git a/after/plugin/telescope.lua b/after/plugin/telescope.lua
new file mode 100644
index 0000000..8dae86b
--- /dev/null
+++ b/after/plugin/telescope.lua
@@ -0,0 +1,4 @@
+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, {})
diff --git a/after/plugin/treesitter.lua b/after/plugin/treesitter.lua
new file mode 100644
index 0000000..86826a0
--- /dev/null
+++ b/after/plugin/treesitter.lua
@@ -0,0 +1,21 @@
+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/init.lua b/init.lua
new file mode 100644
index 0000000..201716d
--- /dev/null
+++ b/init.lua
@@ -0,0 +1,37 @@
+require('wozniak')
+
+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 'mhartington/oceanic-next'
+ use { 'nvim-treesitter/nvim-treesitter', run = {':TSUpdate' } }
+ use {
+ 'VonHeikemen/lsp-zero.nvim',
+ branch = 'v2.x',
+ requires = {
+ -- LSP Support
+ {'neovim/nvim-lspconfig'}, -- Required
+ { -- Optional
+ 'williamboman/mason.nvim',
+ run = function()
+ pcall(vim.cmd, 'MasonUpdate')
+ end,
+ },
+ {'williamboman/mason-lspconfig.nvim'}, -- Optional
+
+ -- Autocompletion
+ {'hrsh7th/nvim-cmp'}, -- Required
+ {'hrsh7th/cmp-nvim-lsp'}, -- Required
+ {'L3MON4D3/LuaSnip'}, -- Required
+ }
+ }
+
+ use 'nvim-lualine/lualine.nvim'
+end)
diff --git a/lua/wozniak/config.lua b/lua/wozniak/config.lua
new file mode 100644
index 0000000..2b76930
--- /dev/null
+++ b/lua/wozniak/config.lua
@@ -0,0 +1,18 @@
+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
new file mode 100644
index 0000000..1bfb2d7
--- /dev/null
+++ b/lua/wozniak/init.lua
@@ -0,0 +1,3 @@
+require('wozniak.remaps')
+require('wozniak.config')
+require('wozniak.remap')
diff --git a/lua/wozniak/remap.lua b/lua/wozniak/remap.lua
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/lua/wozniak/remap.lua
diff --git a/lua/wozniak/remaps.lua b/lua/wozniak/remaps.lua
new file mode 100644
index 0000000..610cc58
--- /dev/null
+++ b/lua/wozniak/remaps.lua
@@ -0,0 +1,2 @@
+vim.g.mapleader = ' '
+vim.keymap.set('n', '<leader>pv', vim.cmd.Ex)
diff --git a/site/pack/packer/start/packer.nvim b/site/pack/packer/start/packer.nvim
new file mode 160000
+Subproject 1d0cf98a561f7fd654c970c49f917d74fafe153