Skip to content

Commit

Permalink
adding nvim configs, debugging needs some work
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Motevasselani committed May 30, 2024
1 parent 041dc52 commit e748630
Show file tree
Hide file tree
Showing 15 changed files with 287 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/nvim/.luarc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"diagnostics.globals": [
"vim"
]
}
16 changes: 16 additions & 0 deletions config/nvim/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-- Lazy setup -- package manager
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or 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)

require("vim-options")
require("lazy").setup("plugins")
29 changes: 29 additions & 0 deletions config/nvim/lazy-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"LuaSnip": { "branch": "master", "commit": "878ace11983444d865a72e1759dbcc331d1ace4c" },
"catppuccin": { "branch": "main", "commit": "5215ea59df6d0a7e27da9a5cd1165e06d1b04cbe" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"cyberdream.nvim": { "branch": "main", "commit": "9eb7c63091d7369eba9015e9c656ca644ba6a3a4" },
"friendly-snippets": { "branch": "main", "commit": "d0610077b6129cf9f7f78afbe3a1425d60f6e2f1" },
"lazy.nvim": { "branch": "main", "commit": "24fa2a97085ca8a7220b5b078916f81e316036fd" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" },
"mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" },
"none-ls-extras.nvim": { "branch": "main", "commit": "336e84b9e43c0effb735b08798ffac382920053b" },
"none-ls.nvim": { "branch": "main", "commit": "f5b960a73418249aebcdae3455de320360509253" },
"nui.nvim": { "branch": "main", "commit": "b1b3dcd6ed8f355c78bad3d395ff645be5f8b6ae" },
"nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" },
"nvim-dap": { "branch": "master", "commit": "fa3a8f75e7a0a4217202000624ca8b72502aa44b" },
"nvim-dap-go": { "branch": "main", "commit": "a0c5a2b991d7e9304a9a032cf177e22a4b0acda1" },
"nvim-dap-python": { "branch": "master", "commit": "3dffa58541d1f52c121fe58ced046268c838d802" },
"nvim-dap-ui": { "branch": "master", "commit": "b7267003ba4dd860350be86f75b9d9ea287cedca" },
"nvim-lspconfig": { "branch": "master", "commit": "38de86f82efd9ba0881203767d6a8e1815abca28" },
"nvim-nio": { "branch": "master", "commit": "632024157d01e8bc48fd7df6a7de8ffe3fdd4f3a" },
"nvim-tmux-navigation": { "branch": "main", "commit": "4898c98702954439233fdaf764c39636681e2861" },
"nvim-treesitter": { "branch": "master", "commit": "5c924407cf110e9da4f3ba02ffed127b4198ad89" },
"nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" },
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }
}
9 changes: 9 additions & 0 deletions config/nvim/lua/plugins/catppuccin.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
return {
"catppuccin/nvim",
lazy = false,
name = "catppuccin",
priority = 1000,
config = function()
-- vim.cmd.colorscheme("catppuccin")
end
}
44 changes: 44 additions & 0 deletions config/nvim/lua/plugins/completions.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
return {
{
"hrsh7th/cmp-nvim-lsp",
},
{
"L3MON4D3/LuaSnip",
dependencies = {
"saadparwaiz1/cmp_luasnip",
"rafamadriz/friendly-snippets",
},
},
{
"hrsh7th/nvim-cmp",
config = function()
local cmp = require("cmp")
require("luasnip.loaders.from_vscode").lazy_load()

cmp.setup({
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
}, {
{ name = "buffer" },
}),
})
end,
},
}
8 changes: 8 additions & 0 deletions config/nvim/lua/plugins/cyberdream.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
return {
"scottmckendry/cyberdream.nvim",
lazy = false,
priority = 1000,
config = function()
vim.cmd.colorscheme("cyberdream")
end,
}
37 changes: 37 additions & 0 deletions config/nvim/lua/plugins/debugging.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
return {
"mfussenegger/nvim-dap",
dependencies = {
"nvim-neotest/nvim-nio",
"rcarriga/nvim-dap-ui",
"leoluz/nvim-dap-go",
"mfussenegger/nvim-dap-python",
},

config = function()
local dap = require("dap")
local dapui = require("dapui")
local dappython = require("dap-python")
local dapgo = require("dap-go")

dapui.setup()
dapgo.setup()
dappython.setup("~/.virtualenvs/debugpy/bin/python")

dap.listeners.before.attach.dapui_config = function()
dapui.open()
end
dap.listeners.before.launch.dapui_config = function()
dapui.open()
end
dap.listeners.before.event_terminated.dapui_config = function()
dapui.close()
end
dap.listeners.before.event_exited.dapui_config = function()
dapui.close()
end

vim.keymap.set("n", "<Leader>dt", dap.toggle_breakpoint, {})
vim.keymap.set("n", "<Leader>dc", dap.continue, {})
vim.keymap.set("n", "<Leader>dl", dappython.test_method, {})
end,
}
40 changes: 40 additions & 0 deletions config/nvim/lua/plugins/lsp-config.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
return {
{
"williamboman/mason.nvim",
lazy = false,
config = function()
require("mason").setup()
end,
},
{
"williamboman/mason-lspconfig.nvim",
lazy = false,
opts = {
auto_install = true,
},
},
{
"neovim/nvim-lspconfig",
lazy = false,
config = function()
local capabilities = require("cmp_nvim_lsp").default_capabilities()

local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup({
capabilities = capabilities,
})
lspconfig.clangd.setup({
capabilities = capabilities,
})
lspconfig.elixirls.setup({
capabilities = capabilities,
})
lspconfig.pyright.setup({
capabilities = capabilities,
})
vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
vim.keymap.set("n", "gd", vim.lsp.buf.definition, {})
vim.keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, {})
end,
},
}
10 changes: 10 additions & 0 deletions config/nvim/lua/plugins/lualine.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
return {
"nvim-lualine/lualine.nvim",
config = function()
require("lualine").setup({
options = {
theme = "dracula",
},
})
end,
}
12 changes: 12 additions & 0 deletions config/nvim/lua/plugins/neotree.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
return {
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
config = function()
vim.keymap.set("n", "<C-n>", ":Neotree filesystem reveal left<CR>", {})
end,
}
25 changes: 25 additions & 0 deletions config/nvim/lua/plugins/none-ls.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
return {
"nvimtools/none-ls.nvim",
dependencies = {
"nvimtools/none-ls-extras.nvim",
},
config = function()
local null_ls = require("null-ls")

null_ls.setup({
sources = {
null_ls.builtins.formatting.stylua,

null_ls.builtins.diagnostics.pylint,
null_ls.builtins.formatting.black,
null_ls.builtins.formatting.isort,

null_ls.builtins.formatting.prettier,
require("none-ls.diagnostics.eslint_d"),
-- null_ls.builtins.diagnostics.eslint_d,
},
})

vim.keymap.set("n", "<leader>gf", vim.lsp.buf.format, {})
end,
}
25 changes: 25 additions & 0 deletions config/nvim/lua/plugins/telescope.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
return {
{
"nvim-telescope/telescope.nvim",
tag = "0.1.6",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<C-p>", builtin.find_files, {})
vim.keymap.set("n", "<leader>fg", builtin.live_grep, {})
end,
},
{
"nvim-telescope/telescope-ui-select.nvim",
config = function()
require("telescope").setup({
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown({}),
},
},
})
require("telescope").load_extension("ui-select")
end,
},
}
10 changes: 10 additions & 0 deletions config/nvim/lua/plugins/tmux-navigation.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
return {
"alexghergh/nvim-tmux-navigation",
config = function()
require("nvim-tmux-navigation").setup({})
vim.keymap.set("n", "<C-h>", "<Cmd>NvimTmuxNavigateLeft<CR>", {})
vim.keymap.set("n", "<C-j>", "<Cmd>NvimTmuxNavigateDown<CR>", {})
vim.keymap.set("n", "<C-k>", "<Cmd>NvimTmuxNavigateUp<CR>", {})
vim.keymap.set("n", "<C-l>", "<Cmd>NvimTmuxNavigateRight<CR>", {})
end,
}
12 changes: 12 additions & 0 deletions config/nvim/lua/plugins/treesitter.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local configs = require("nvim-treesitter.configs")
configs.setup({
auto_install = true,
highlight = { enable = true },
indent = { enable = true },
})
end,
}
5 changes: 5 additions & 0 deletions config/nvim/lua/vim-options.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
vim.cmd("set expandtab")
vim.cmd("set tabstop=2")
vim.cmd("set softtabstop=2")
vim.cmd("set shiftwidth=2")
vim.g.mapleader = " "

0 comments on commit e748630

Please sign in to comment.