Initial commit

This commit is contained in:
Cameron Reed 2024-01-30 21:13:47 -07:00
commit 0819470e93
11 changed files with 171 additions and 0 deletions

9
after/plugin/colors.lua Normal file
View File

@ -0,0 +1,9 @@
function SetColorScheme(color)
color = color or "tokyonight"
vim.cmd.colorscheme(color)
-- vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
-- vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
end
SetColorScheme()

11
after/plugin/harpoon.lua Normal file
View File

@ -0,0 +1,11 @@
local mark = require("harpoon.mark")
local ui = require("harpoon.ui")
vim.keymap.set("n", "<leader>a", mark.add_file);
vim.keymap.set("n", "<C-;>", ui.toggle_quick_menu)
vim.keymap.set("n", "<C-h>", function() ui.nav_file(1) end);
vim.keymap.set("n", "<C-j>", function() ui.nav_file(2) end);
vim.keymap.set("n", "<C-k>", function() ui.nav_file(3) end);
vim.keymap.set("n", "<C-l>", function() ui.nav_file(4) end);

31
after/plugin/lsp-zero.lua Normal file
View File

@ -0,0 +1,31 @@
local lsp_zero_config = {
call_servers = 'global',
}
local lsp_servers = {
'zls',
'nixd',
'gopls',
'pylsp',
'templ',
'ansiblels',
'rust_analyzer',
}
vim.filetype.add({ extension = { templ = "templ" } })
local lsp = require('lsp-zero').preset({})
lsp.set_preferences(lsp_zero_config)
lsp.on_attach(function(_, bufnr)
lsp.default_keymaps({buffer = bufnr})
end)
lsp.setup_servers(lsp_servers)
local lsp_config = require('lspconfig')
lsp_config.lua_ls.setup(lsp.nvim_lua_ls())
lsp.setup()

View File

@ -0,0 +1,7 @@
local builtins = require('telescope.builtin')
vim.keymap.set("n", "<leader>pf", builtins.find_files, {})
vim.keymap.set("n", "<leader>pg", builtins.git_files, {})
vim.keymap.set("n", "<leader>pc", builtins.live_grep, {})
vim.keymap.set("n", "<leader>cs", builtins.colorscheme, {})

View File

@ -0,0 +1,17 @@
require'nvim-treesitter.configs'.setup {
ensure_installed = { "c", "rust", "lua", "vim", "vimdoc", "query", "sql", "zig" },
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,
ignore_install = { },
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
}

View File

@ -0,0 +1 @@
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)

1
init.lua Normal file
View File

@ -0,0 +1 @@
require("cam123")

4
lua/cam123/init.lua Normal file
View File

@ -0,0 +1,4 @@
require("cam123.set")
require("cam123.remap")
require("cam123.lazy")

68
lua/cam123/lazy.lua Normal file
View File

@ -0,0 +1,68 @@
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
local uv = vim.uv or vim.loop
-- Auto-install lazy.nvim if not present
if not uv.fs_stat(lazypath) then
print('Installing lazy.nvim....')
vim.fn.system({
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
})
print('Done.')
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup({
{'folke/tokyonight.nvim'},
{'ThePrimeagen/vim-be-good'},
{
'kristijanhusak/vim-dadbod-ui',
dependencies = {
{'tpope/vim-dadbod'},
{'kristijanhusak/vim-dadbod-completion'},
}
},
{'tpope/vim-fugitive'},
{
'VonHeikemen/lsp-zero.nvim',
branch = 'v2.x',
dependencies = {
{'neovim/nvim-lspconfig'},
{'hrsh7th/nvim-cmp'},
{'hrsh7th/cmp-nvim-lsp'},
{'L3MON4D3/LuaSnip'},
}
},
{
'nvim-treesitter/nvim-treesitter',
build = ":TSUpdate"
},
{
'nvim-telescope/telescope.nvim', branch = '0.1.x',
dependencies = {
{'nvim-lua/plenary.nvim'},
}
},
{'mbbill/undotree'},
{
'ThePrimeagen/harpoon',
dependencies = {
{'nvim-lua/plenary.nvim'},
}
},
})

1
lua/cam123/remap.lua Normal file
View File

@ -0,0 +1 @@
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)

21
lua/cam123/set.lua Normal file
View File

@ -0,0 +1,21 @@
vim.opt.nu = true
vim.opt.relativenumber = true;
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.wrap = false
vim.opt.termguicolors = true
vim.opt.scrolloff = 8
vim.opt.updatetime = 50
-- vim.opt.colorcolumn = "120"
vim.g.mapleader = " "