commit 60acd4a5f25b34e76e8dfc1ae2250e1bf8db227f
Author: Andrew <andrewlaack1@gmail.com>
Date: Sat, 6 Apr 2024 23:08:01 -0500
init
Diffstat:
6 files changed, 281 insertions(+), 0 deletions(-)
diff --git a/README.md b/README.md
@@ -0,0 +1,7 @@
+# Neovim
+
+Just some basic configuration information.
+
+## Install
+
+To install you should just need to clone the repo to ~/.config/nvim. Might also need to install packer using a git command but that is not too bad. Beyond that you will need to run PackerInstall and PackerSync to get all the plugins set up propertly. The final thing to do would be to install the language servers you need using MasonInstall as this is done on a case by case basis.
diff --git a/init.lua b/init.lua
@@ -0,0 +1,3 @@
+require("core.keymaps")
+require("core.plugins")
+require("core.lsp_config")
diff --git a/lua/core/keymaps.lua b/lua/core/keymaps.lua
@@ -0,0 +1,32 @@
+vim.opt.spelllang = { 'en_us' }
+
+-- here you can setup the language servers
+vim.cmd.colorscheme "catppuccin"
+
+vim.opt.conceallevel = 1 -- or 2
+vim.opt.number = true
+vim.opt.shiftwidth = 0
+vim.opt.linebreak = true
+vim.opt.clipboard = 'unnamedplus'
+vim.g.mapleader = ' '
+
+-- Key mappings
+vim.api.nvim_set_keymap('n', '<C-p>', ':Telescope find_files<CR>', { silent = true })
+
+vim.api.nvim_set_keymap('n', '<leader>v', ':split<CR>', { silent = true })
+vim.api.nvim_set_keymap('n', '<leader>h', ':vsplit<CR>', { silent = true })
+vim.api.nvim_set_keymap('n', '<leader>n', '<C-w>h', { silent = true })
+vim.api.nvim_set_keymap('n', '<leader>u', '<C-w>k', { silent = true })
+vim.api.nvim_set_keymap('n', '<leader>e', '<C-w>j', { silent = true })
+vim.api.nvim_set_keymap('n', '<leader>i', '<C-w>l', { silent = true })
+vim.api.nvim_set_keymap('n', '<leader>t', ':let $VIM_DIR=expand(\'%:p:h\')<CR>:terminal<CR>cd $VIM_DIR<CR>', { silent = true })
+vim.cmd('autocmd TermOpen * startinsert')
+vim.api.nvim_set_keymap('i', '<expr> <TAB>', 'pumvisible() ? "<C-y>" : "<TAB>"', { silent = true })
+
+vim.opt.tabstop = 4
+
+
+
+
+vim.api.nvim_set_keymap('n', '<Leader>s', ':set spell<CR>', { noremap = true, silent = true })
+vim.api.nvim_set_keymap('n', '<Leader>S', ':set nospell<CR>', { noremap = true, silent = true })
diff --git a/lua/core/lsp_config.lua b/lua/core/lsp_config.lua
@@ -0,0 +1,35 @@
+local lsp_zero = require('lsp-zero')
+
+lsp_zero.on_attach(function(client, bufnr)
+ -- see :help lsp-zero-keybindings
+ -- to learn the available actions
+ lsp_zero.default_keymaps({buffer = bufnr})
+end)
+
+require('mason').setup({})
+
+-- just in case: there is no need to copy/paste this example in your own config
+-- this snippet exists only for educational purpose.
+
+require('mason-lspconfig').setup({
+ handlers = {
+ function(name)
+ local lsp = require('lspconfig')[name]
+ if lsp.manager then
+ -- if lsp.manager is defined it means the
+ -- language server was configured some place else
+ return
+ end
+
+ -- at this point lsp-zero has already applied
+ -- the "capabilities" options to lspconfig's defaults.
+ -- so there is no need to add them here manually.
+
+ lsp.setup({})
+ end,
+ },
+})
+
+
+
+
diff --git a/lua/core/plugins.lua b/lua/core/plugins.lua
@@ -0,0 +1,47 @@
+local ensure_packer = function()
+ local fn = vim.fn
+ local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
+ if fn.empty(fn.glob(install_path)) > 0 then
+ fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
+ vim.cmd [[packadd packer.nvim]]
+ return true
+ end
+ return false
+end
+
+local packer_bootstrap = ensure_packer()
+
+return require('packer').startup(function(use)
+ use 'wbthomason/packer.nvim'
+
+
+ use({ "iamcco/markdown-preview.nvim", run = "cd app && npm install", setup = function() vim.g.mkdp_filetypes = { "markdown" } end, ft = { "markdown" }, })
+use {
+ 'nvim-telescope/telescope.nvim', tag = '0.1.6',
+ requires = { {'nvim-lua/plenary.nvim'} }
+}
+use { "catppuccin/nvim", as = "catppuccin" }
+
+use {
+ 'VonHeikemen/lsp-zero.nvim',
+ branch = 'v3.x',
+ requires = {
+ {'neovim/nvim-lspconfig'},
+ {'hrsh7th/nvim-cmp'},
+ {'hrsh7th/cmp-nvim-lsp'},
+ {'L3MON4D3/LuaSnip'},
+ }
+}
+
+
+
+
+ if packer_bootstrap then
+ require('packer').sync()
+ end
+
+
+
+
+
+end)
diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua
@@ -0,0 +1,157 @@
+-- Automatically generated packer.nvim plugin loader code
+
+if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then
+ vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"')
+ return
+end
+
+vim.api.nvim_command('packadd packer.nvim')
+
+local no_errors, error_msg = pcall(function()
+
+_G._packer = _G._packer or {}
+_G._packer.inside_compile = true
+
+local time
+local profile_info
+local should_profile = false
+if should_profile then
+ local hrtime = vim.loop.hrtime
+ profile_info = {}
+ time = function(chunk, start)
+ if start then
+ profile_info[chunk] = hrtime()
+ else
+ profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
+ end
+ end
+else
+ time = function(chunk, start) end
+end
+
+local function save_profiles(threshold)
+ local sorted_times = {}
+ for chunk_name, time_taken in pairs(profile_info) do
+ sorted_times[#sorted_times + 1] = {chunk_name, time_taken}
+ end
+ table.sort(sorted_times, function(a, b) return a[2] > b[2] end)
+ local results = {}
+ for i, elem in ipairs(sorted_times) do
+ if not threshold or threshold and elem[2] > threshold then
+ results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
+ end
+ end
+ if threshold then
+ table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)')
+ end
+
+ _G._packer.profile_output = results
+end
+
+time([[Luarocks path setup]], true)
+local package_path_str = "/home/andrew/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/andrew/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/andrew/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/andrew/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
+local install_cpath_pattern = "/home/andrew/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so"
+if not string.find(package.path, package_path_str, 1, true) then
+ package.path = package.path .. ';' .. package_path_str
+end
+
+if not string.find(package.cpath, install_cpath_pattern, 1, true) then
+ package.cpath = package.cpath .. ';' .. install_cpath_pattern
+end
+
+time([[Luarocks path setup]], false)
+time([[try_loadstring definition]], true)
+local function try_loadstring(s, component, name)
+ local success, result = pcall(loadstring(s), name, _G.packer_plugins[name])
+ if not success then
+ vim.schedule(function()
+ vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
+ end)
+ end
+ return result
+end
+
+time([[try_loadstring definition]], false)
+time([[Defining packer_plugins]], true)
+_G.packer_plugins = {
+ LuaSnip = {
+ loaded = true,
+ path = "/home/andrew/.local/share/nvim/site/pack/packer/start/LuaSnip",
+ url = "https://github.com/L3MON4D3/LuaSnip"
+ },
+ catppuccin = {
+ loaded = true,
+ path = "/home/andrew/.local/share/nvim/site/pack/packer/start/catppuccin",
+ url = "https://github.com/catppuccin/nvim"
+ },
+ ["cmp-nvim-lsp"] = {
+ loaded = true,
+ path = "/home/andrew/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
+ url = "https://github.com/hrsh7th/cmp-nvim-lsp"
+ },
+ ["lsp-zero.nvim"] = {
+ loaded = true,
+ path = "/home/andrew/.local/share/nvim/site/pack/packer/start/lsp-zero.nvim",
+ url = "https://github.com/VonHeikemen/lsp-zero.nvim"
+ },
+ ["markdown-preview.nvim"] = {
+ loaded = false,
+ needs_bufread = false,
+ only_cond = false,
+ path = "/home/andrew/.local/share/nvim/site/pack/packer/opt/markdown-preview.nvim",
+ url = "https://github.com/iamcco/markdown-preview.nvim"
+ },
+ ["nvim-cmp"] = {
+ loaded = true,
+ path = "/home/andrew/.local/share/nvim/site/pack/packer/start/nvim-cmp",
+ url = "https://github.com/hrsh7th/nvim-cmp"
+ },
+ ["nvim-lspconfig"] = {
+ loaded = true,
+ path = "/home/andrew/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
+ url = "https://github.com/neovim/nvim-lspconfig"
+ },
+ ["packer.nvim"] = {
+ loaded = true,
+ path = "/home/andrew/.local/share/nvim/site/pack/packer/start/packer.nvim",
+ url = "https://github.com/wbthomason/packer.nvim"
+ },
+ ["plenary.nvim"] = {
+ loaded = true,
+ path = "/home/andrew/.local/share/nvim/site/pack/packer/start/plenary.nvim",
+ url = "https://github.com/nvim-lua/plenary.nvim"
+ },
+ ["telescope.nvim"] = {
+ loaded = true,
+ path = "/home/andrew/.local/share/nvim/site/pack/packer/start/telescope.nvim",
+ url = "https://github.com/nvim-telescope/telescope.nvim"
+ }
+}
+
+time([[Defining packer_plugins]], false)
+-- Setup for: markdown-preview.nvim
+time([[Setup for markdown-preview.nvim]], true)
+try_loadstring("\27LJ\2\n=\0\0\2\0\4\0\0056\0\0\0009\0\1\0005\1\3\0=\1\2\0K\0\1\0\1\2\0\0\rmarkdown\19mkdp_filetypes\6g\bvim\0", "setup", "markdown-preview.nvim")
+time([[Setup for markdown-preview.nvim]], false)
+vim.cmd [[augroup packer_load_aucmds]]
+vim.cmd [[au!]]
+ -- Filetype lazy-loads
+time([[Defining lazy-load filetype autocommands]], true)
+vim.cmd [[au FileType markdown ++once lua require("packer.load")({'markdown-preview.nvim'}, { ft = "markdown" }, _G.packer_plugins)]]
+time([[Defining lazy-load filetype autocommands]], false)
+vim.cmd("augroup END")
+
+_G._packer.inside_compile = false
+if _G._packer.needs_bufread == true then
+ vim.cmd("doautocmd BufRead")
+end
+_G._packer.needs_bufread = false
+
+if should_profile then save_profiles() end
+
+end)
+
+if not no_errors then
+ error_msg = error_msg:gsub('"', '\\"')
+ vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None')
+end