Merging Windows into main
This commit is contained in:
@ -1,36 +0,0 @@
|
||||
local dap = require("dap")
|
||||
print("You opened a Golang file")
|
||||
|
||||
dap.adapters.delve = {
|
||||
type = 'server',
|
||||
port = '${port}',
|
||||
executable = {
|
||||
command = 'dlv',
|
||||
args = {'dap', '-l', '127.0.0.1:${port}'},
|
||||
}
|
||||
}
|
||||
|
||||
-- https://github.com/go-delve/delve/blob/master/Documentation/usage/dlv_dap.md
|
||||
dap.configurations.go = {
|
||||
{
|
||||
type = "delve",
|
||||
name = "Debug",
|
||||
request = "launch",
|
||||
program = "${file}"
|
||||
},
|
||||
{
|
||||
type = "delve",
|
||||
name = "Debug test", -- configuration for debugging test files
|
||||
request = "launch",
|
||||
mode = "test",
|
||||
program = "${file}"
|
||||
},
|
||||
-- works with go.mod packages and sub packages
|
||||
{
|
||||
type = "delve",
|
||||
name = "Debug test (go.mod)",
|
||||
request = "launch",
|
||||
mode = "test",
|
||||
program = "./${relativeFileDirname}"
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
--[[
|
||||
-- Only setup for windows
|
||||
-- Don't know if all this is actually necessary
|
||||
-- TODO: FIX: Clean this mess up ~ 03/28/2024
|
||||
--]]
|
||||
if vim.loop.os_uname().sysname == 'Windows_NT' then
|
||||
Cmd = 'c:/Users/nigel/Appdata/Local/nvim-data/mason/bin/jdtls.cmd'
|
||||
JavaDebug = vim.fn.glob("C:/Users/nigel/AppData/Local/nvim-data/java-debug/com.microsoft.java.debug.plugin/target/com.microsoft.java.debug.plugin-0.52.0.jar", 1)
|
||||
else
|
||||
Cmd = ''
|
||||
JavaDebug = nil
|
||||
end
|
||||
local config = {
|
||||
cmd = {Cmd},
|
||||
root_dir = vim.fs.dirname(vim.fs.find({'gradlew', '.git', 'mvnw'}, { upward = true })[1]),
|
||||
init_options = {
|
||||
bundles = {
|
||||
JavaDebug
|
||||
}
|
||||
}
|
||||
}
|
||||
require('jdtls').start_or_attach(config)
|
||||
require('jdtls').setup_dap({hotcodreplace='auto'})
|
||||
require('jdtls.dap').setup_dap_main_class_configs()
|
@ -1 +0,0 @@
|
||||
print("You opened a LUA file..")
|
@ -1,6 +1,5 @@
|
||||
require("barink.vim")
|
||||
require("barink.keys")
|
||||
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
|
@ -1,16 +1,16 @@
|
||||
-- Keymaps
|
||||
vim.g.mapleader = " "
|
||||
|
||||
vim.keymap.set("n", "<leader><F8>", vim.cmd.UndotreeToggle)
|
||||
vim.keymap.set("n", "<leader>p", [["_dP]])
|
||||
vim.keymap.set("n", "<leader>fa", vim.lsp.buf.format)
|
||||
vim.keymap.set("n", "<leader>m", ":Mason<CR>")
|
||||
vim.keymap.set("n", "<leader>e", ":Explore<CR>", { noremap = false, silent = true })
|
||||
vim.keymap.set("n", "<leader>le", ":Lexplore<CR>", { noremap = false, silent = true })
|
||||
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true })
|
||||
-- Move lines while in visual mode
|
||||
vim.keymap.set("v", "<A-S-j>", ":m '>+1<CR>gv=gv", { noremap = true })
|
||||
vim.keymap.set("v", "<A-S-k>", ":m '<-2<CR>gv=gv", { noremap = true })
|
||||
vim.keymap.set('n', '<leader><F8>', vim.cmd.UndotreeToggle)
|
||||
vim.keymap.set('n', '<leader>p', [["_dP]])
|
||||
vim.keymap.set('n', '<leader>fa', vim.lsp.buf.format)
|
||||
vim.keymap.set('n', '<leader>m', ":Mason<CR>")
|
||||
vim.keymap.set('n', '<leader>e',':Explore<CR>', {noremap = false, silent=true})
|
||||
vim.keymap.set('n', '<leader>le',':Lexplore<CR>', {noremap = false, silent=true})
|
||||
vim.keymap.set('n', '<leader>l', ':Neotree<CR>', {noremap = false, silent= true})
|
||||
-- Move lines while in visual mode
|
||||
vim.keymap.set('v', '<A-S-j>', ':m \'>+1<CR>gv=gv', {noremap = true})
|
||||
vim.keymap.set('v', '<A-S-k>', ':m \'<-2<CR>gv=gv', {noremap = true})
|
||||
|
||||
-- Move lines while in normal mode
|
||||
vim.keymap.set("n", "<A-S-j>", ":m .+1<CR>==", { noremap = true })
|
||||
@ -21,18 +21,11 @@ vim.keymap.set("i", "<A-j>", ":m .+1<CR>==gi", { noremap = true })
|
||||
vim.keymap.set("i", "<A-k>", ":m .-2<CR>==gi", { noremap = true })
|
||||
|
||||
-- Diagnostics !
|
||||
vim.keymap.set("n", "<C-T>", function()
|
||||
require("trouble").toggle()
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>d", function()
|
||||
vim.diagnostic.open_float()
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>dn", function()
|
||||
vim.diagnostic.goto_next()
|
||||
end)
|
||||
vim.keymap.set("n", "<leader>dp", function()
|
||||
vim.diagnostic.goto_prev()
|
||||
end)
|
||||
vim.keymap.set('n', '<C-T>', function() require('trouble').toggle() end )
|
||||
vim.keymap.set('n', '<leader>d', function () vim.diagnostic.open_float() end )
|
||||
vim.keymap.set('n', '<leader>dn', function () vim.diagnostic.goto_next() end )
|
||||
vim.keymap.set('n', '<leader>dp', function () vim.diagnostic.goto_prev() end )
|
||||
vim.keymap.set('n', '<C-d>', function () vim.lsp.buf.code_action() end)
|
||||
|
||||
-- Debugging
|
||||
vim.keymap.set("n", "<leader>sb", function()
|
||||
|
14
lua/barink/plugins/Oil.lua
Normal file
14
lua/barink/plugins/Oil.lua
Normal file
@ -0,0 +1,14 @@
|
||||
return {
|
||||
{
|
||||
"stevearc/oil.nvim",
|
||||
opt = {
|
||||
default_file_explorer = false
|
||||
},
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons'
|
||||
},
|
||||
config = function ()
|
||||
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc= "Open parent directory"})
|
||||
end
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
return {
|
||||
{
|
||||
'David-kunz/gen.nvim',
|
||||
opts = {
|
||||
model = "codellama:7b",
|
||||
host = "localhost",
|
||||
port = "11434",
|
||||
quit_mape = "q",
|
||||
init = function (options) pcall(io.popen("ollama serve > /dev/null 2>&1 &)")) end,
|
||||
display_mode = "split",
|
||||
command =function (options)
|
||||
local body = {model = options.model, stream=true}
|
||||
return "curl --silent --no-buffer -X POST http://" .. options.host .. ':' .. options.port .. "/api/chat -d $body"
|
||||
end,
|
||||
},
|
||||
}
|
||||
}
|
@ -1,11 +1,9 @@
|
||||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
opts = {
|
||||
-- add any options here
|
||||
},
|
||||
config = function ()
|
||||
require("Comment").setup()
|
||||
end,
|
||||
lazy = false,
|
||||
opts = {
|
||||
},
|
||||
config = function()
|
||||
require("Comment").setup()
|
||||
end
|
||||
}
|
||||
|
||||
|
@ -1,18 +1,35 @@
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
opts = {},
|
||||
config = function()
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
javascript = { { "prettierd", "prettier" } },
|
||||
},
|
||||
})
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
pattern = "*",
|
||||
callback = function(args)
|
||||
require("conform").format({ buffer = args.buf })
|
||||
end,
|
||||
})
|
||||
end,
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre"},
|
||||
cmd = { "ConformInfo"},
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
php = { "pint"},
|
||||
lua = { "stylua"},
|
||||
javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
typescript = { "prettierd", "prettier", stop_after_first = true },
|
||||
},
|
||||
format_on_save = { timeout_ms = 500 },
|
||||
default_format_ops = {
|
||||
lsp_format = "fallback"
|
||||
},
|
||||
},
|
||||
config = function ()
|
||||
require("conform").setup()
|
||||
-- Command to run async formatting
|
||||
vim.api.nvim_create_user_command("Format", function(args)
|
||||
local range = nil
|
||||
if args.count ~= -1 then
|
||||
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
|
||||
range = {
|
||||
start = { args.line1, 0 },
|
||||
["end"] = { args.line2, end_line:len() },
|
||||
}
|
||||
end
|
||||
require("conform").format({ async = true, lsp_format = "fallback", range = range })
|
||||
end, { range = true })
|
||||
|
||||
|
||||
end
|
||||
}
|
||||
|
||||
|
16
lua/barink/plugins/dadbod-ui.lua
Normal file
16
lua/barink/plugins/dadbod-ui.lua
Normal file
@ -0,0 +1,16 @@
|
||||
return {
|
||||
"kristijanhusak/vim-dadbod-ui",
|
||||
dependencies = {
|
||||
{'tpope/vim-dadbod', lazy = true },
|
||||
{ 'kristijanhusak/vim-dadbod-completion', ft = { 'sql', 'mysql', 'plsql'}, lazy = true },
|
||||
},
|
||||
cmd = {
|
||||
'DBUI',
|
||||
'DBUIToggle',
|
||||
'DBUIAddConnection',
|
||||
'DBUIFindBuffer',
|
||||
},
|
||||
init = function ()
|
||||
vim.g.db_ui_use_nerd_fonts = 1
|
||||
end
|
||||
}
|
@ -22,13 +22,52 @@ return {
|
||||
},
|
||||
config = function ()
|
||||
local dap = require('dap')
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = "Launch",
|
||||
type= "codelldb",
|
||||
request = "launch",
|
||||
program = function ()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() , 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}/Framework',
|
||||
stopOnEntry = false,
|
||||
}
|
||||
}
|
||||
dap.adapters.lldb = {
|
||||
type = 'executable',
|
||||
command = "C:\\Program Files\\LLVM\\bin\\lldb-dap.exe",
|
||||
name = 'lldb'
|
||||
}
|
||||
|
||||
-- Zig configuration
|
||||
dap.configurations.zig = {
|
||||
name = 'launch',
|
||||
type= 'lldb',
|
||||
request = 'launch',
|
||||
program = '${workspaceFolder}/zig-out/bin/tests.exe',
|
||||
cwd = '${workspaceFolder}',
|
||||
}
|
||||
-- Java configuration
|
||||
-- See also ftplugin
|
||||
dap.configurations.java = {
|
||||
{
|
||||
type = 'java';
|
||||
request = 'launch';
|
||||
name = "Launch file";
|
||||
program = "java ${file}";
|
||||
type = 'java',
|
||||
request = 'launch',
|
||||
name = "Launch file",
|
||||
program = "java ${file}",
|
||||
}}
|
||||
dap.configurations.cpp = {{
|
||||
name="launch",
|
||||
type="lldb",
|
||||
request="launch",
|
||||
program = function ()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() ..'/', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = false,
|
||||
args = {},
|
||||
}}
|
||||
dap.configurations.go = {
|
||||
{
|
||||
type = "delve",
|
||||
@ -60,6 +99,14 @@ return {
|
||||
args = {'dap', '-l', '127.0.0.1:${port}'},
|
||||
}
|
||||
}
|
||||
dap.adapters.codelldb = {
|
||||
type= 'server',
|
||||
port = '${port}',
|
||||
executable = {
|
||||
command = 'C:/Users/Nigel/Appdata/Local/nvim-data/mason/bin/codelldb.cmd',
|
||||
args = {"--port", "${port}"}
|
||||
}
|
||||
}
|
||||
end
|
||||
}
|
||||
}
|
||||
|
29
lua/barink/plugins/edgy.lua
Normal file
29
lua/barink/plugins/edgy.lua
Normal file
@ -0,0 +1,29 @@
|
||||
return {
|
||||
"folke/edgy.nvim",
|
||||
event = "VeryLazy",
|
||||
opts= {
|
||||
bottom ={
|
||||
{
|
||||
ft = "toggleterm",
|
||||
size = { height = 0.4 },
|
||||
filter = function (_, win)
|
||||
return vim.api.nvim_win_get_config(win).relative == ""
|
||||
end,
|
||||
},
|
||||
{
|
||||
ft = "lazyterm",
|
||||
title = "Lazyterm",
|
||||
size = { height = 0.4 },
|
||||
filter = function(buf, _)
|
||||
return not vim.b[buf].lazyterm_cmd
|
||||
end
|
||||
}
|
||||
},
|
||||
init = function ()
|
||||
vim.opt.laststatus = 3
|
||||
vim.opt.splitkeep = "screen"
|
||||
end,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,8 +0,0 @@
|
||||
return {
|
||||
"j-hui/fidget.nvim",
|
||||
opts = {
|
||||
notification = {
|
||||
window = { winblend = 0},
|
||||
},
|
||||
},
|
||||
}
|
@ -1,10 +1,14 @@
|
||||
return {
|
||||
'ThePrimeagen/git-worktree.nvim',
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope.nvim'
|
||||
},
|
||||
init = function()
|
||||
require("git-worktree").setup()
|
||||
require("telescope").load_extension("git_worktree")
|
||||
end
|
||||
{
|
||||
'ThePrimeagen/git-worktree.nvim',
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
},
|
||||
opts = {},
|
||||
init = function ()
|
||||
require("git-worktree").setup()
|
||||
require("telescope").load_extension("git_worktree")
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
|
4
lua/barink/plugins/gitsigns.lua
Normal file
4
lua/barink/plugins/gitsigns.lua
Normal file
@ -0,0 +1,4 @@
|
||||
return {
|
||||
'lewis6991/gitsigns.nvim',
|
||||
opt = {}
|
||||
}
|
@ -1,56 +1,54 @@
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"williamboman/mason-lspconfig",
|
||||
"williamboman/mason.nvim",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"hrsh7th/nvim-cmp",
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
dependencies = "hrsh7th/nvim-cmp",
|
||||
version = "v2.*",
|
||||
},
|
||||
{ "mfussenegger/nvim-jdtls", dependencies = { "nvim-dap" } },
|
||||
{
|
||||
"olrtg/nvim-emmet",
|
||||
config = function()
|
||||
vim.keymap.set({ "n", "v" }, "<leader>xe", require("nvim-emmet").wrap_with_abbreviation)
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { "lua_ls", "bashls", "rust_analyzer" },
|
||||
})
|
||||
local cmp = require("cmp")
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
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 }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "path" },
|
||||
{ name = "nvim_lsp", keyword_length = 1 },
|
||||
{ name = "luasnip", option = { show_autosnippets = true } },
|
||||
}, {
|
||||
{ name = "buffer", keyword_length = 2 },
|
||||
}),
|
||||
window = {
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
})
|
||||
return
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
{
|
||||
"folke/neoconf.nvim",
|
||||
opts = {}
|
||||
},
|
||||
"williamboman/mason-lspconfig",
|
||||
"williamboman/mason.nvim",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"hrsh7th/nvim-cmp",
|
||||
{
|
||||
'L3MON4D3/LuaSnip',
|
||||
dependencies = 'hrsh7th/nvim-cmp',
|
||||
version = "v2.*",
|
||||
},
|
||||
{'mfussenegger/nvim-jdtls', dependencies = {'nvim-dap'}},
|
||||
},
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { "lua_ls", "bashls", "rust_analyzer" }
|
||||
})
|
||||
local cmp = require('cmp')
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
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 }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp', keyword_length = 1 },
|
||||
{ name = 'luasnip', option = { show_autosnippets = true}},
|
||||
{ name = 'path' },
|
||||
}, {
|
||||
{ name = 'buffer', keyword_length = 2 },
|
||||
}),
|
||||
window = {
|
||||
documentation = cmp.config.window.bordered()
|
||||
},
|
||||
|
||||
-- Set configuration for specific filetype.
|
||||
cmp.setup.filetype("gitcommit", {
|
||||
@ -82,7 +80,12 @@ return {
|
||||
|
||||
local lsp = require("lspconfig")
|
||||
|
||||
lsp.emmet_language_server.setup({})
|
||||
local ls = require("luasnip")
|
||||
ls.config.set_config({
|
||||
history = true,
|
||||
updateevents = "TextChanged, TextChangedI",
|
||||
enable_autosnippets = true,
|
||||
})
|
||||
|
||||
lsp.lua_ls.setup({
|
||||
capabilities = require("cmp_nvim_lsp").default_capabilities(),
|
||||
@ -101,51 +104,82 @@ return {
|
||||
enable_autosnippets = true,
|
||||
})
|
||||
|
||||
vim.keymap.set({ "i", "s" }, "<C-K>", function()
|
||||
ls.expand()
|
||||
end, { silent = true })
|
||||
vim.keymap.set({ "i", "s" }, "<C-L>", function()
|
||||
ls.jump(1)
|
||||
end, { silent = true })
|
||||
vim.keymap.set({ "i", "s" }, "<C-J>", function()
|
||||
ls.jump(-1)
|
||||
end, { silent = true })
|
||||
vim.keymap.set({ "i", "s" }, "<C-E>", function()
|
||||
if ls.choice_active() then
|
||||
ls.change_choice(1)
|
||||
end
|
||||
end, { silent = true })
|
||||
require("luasnip.loaders.from_lua").load({paths= "~/.config/nvim/lua/barink/snippets"})
|
||||
|
||||
require("luasnip.loaders.from_lua").load({ paths = "C:\\Users\\nigel\\AppData\\Local\\nvim\\lua\\snippets" })
|
||||
|
||||
-- Set up lspconfig.
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
-- Set up lspconfig.
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
local lsp = require("lspconfig")
|
||||
|
||||
require("lspconfig")["asm_lsp"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
local language_server = {
|
||||
asm_lsp= true,
|
||||
zls = true,
|
||||
emmet_language_server = true,
|
||||
rust_analyzer = true,
|
||||
jdtls = true,
|
||||
pylsp = true,
|
||||
phpactor = {
|
||||
init_options = {
|
||||
["language_server_phpstan.enabled"] = false,
|
||||
["language_server_psalm.enabled"] = false,
|
||||
}
|
||||
},
|
||||
clangd = {
|
||||
capabilities = capabilities,
|
||||
root_dir = require('lspconfig').util.root_pattern("compile_commands.json", "compile_flags.txt", ".git"),
|
||||
cmd = {"clangd"},
|
||||
filetypes = { "c", "cpp", "objc", "objcpp"},
|
||||
settings = {
|
||||
clangd = {
|
||||
compilationDatabasePath = "compile-commands.json",
|
||||
},
|
||||
}
|
||||
},
|
||||
ts_ls = true,
|
||||
gopls = true,
|
||||
intelephense = true,
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { 'vim'}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
require("lspconfig")["zls"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
for name, config in pairs(language_server) do
|
||||
if config == true then
|
||||
config = {}
|
||||
end
|
||||
config = vim.tbl_deep_extend("force", {}, { capabilities = capabilities }, config)
|
||||
lsp[name].setup({})
|
||||
end
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
callback = function (args)
|
||||
local client = assert(vim.lsp.get_client_by_id(args.data.client_id), "must have valid client")
|
||||
|
||||
require("lspconfig")["rust_analyzer"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
local settings = language_server[client.name]
|
||||
if type(settings) ~= "table" then
|
||||
settings = {}
|
||||
end
|
||||
|
||||
require("lspconfig")["jdtls"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
local builtin = require "telescope.builtin"
|
||||
|
||||
require("lspconfig")["bashls"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
vim.opt_local.omnifunc = "v:lua.vim.lsp.omnifunc"
|
||||
vim.keymap.set("n", "gd", builtin.lsp_definitions, {buffer = -1})
|
||||
vim.keymap.set("n", "gr", builtin.lsp_references, {buffer = -1})
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, {buffer = -1})
|
||||
vim.keymap.set("n", "gT", vim.lsp.buf.type_definition, {buffer = -1})
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, {buffer = -1})
|
||||
|
||||
require("lspconfig")["tsserver"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
require("lspconfig")["gopls"].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
vim.keymap.set("n", "<LEADER>cr", vim.lsp.buf.rename, {buffer =-1})
|
||||
vim.keymap.set("n", "<LEADER>ca", vim.lsp.buf.code_action, {buffer = -1})
|
||||
vim.keymap.set("n", "<LEADER>wd", builtin.lsp_document_symbols, {buffer = -1})
|
||||
|
||||
|
||||
end
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
9
lua/barink/plugins/neo-tree.lua
Normal file
9
lua/barink/plugins/neo-tree.lua
Normal file
@ -0,0 +1,9 @@
|
||||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim"
|
||||
},
|
||||
}
|
11
lua/barink/plugins/noice.lua
Normal file
11
lua/barink/plugins/noice.lua
Normal file
@ -0,0 +1,11 @@
|
||||
return {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
},
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
"rcarriga/nvim-notify",
|
||||
},
|
||||
|
||||
}
|
@ -1,14 +1,14 @@
|
||||
return {
|
||||
'stevearc/oil.nvim',
|
||||
opts = {},
|
||||
dependencies = {"nvim-tree/nvim-web-devicons"},
|
||||
config = function ()
|
||||
require("oil").setup(
|
||||
{
|
||||
default_file_explorer=false
|
||||
}
|
||||
)
|
||||
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory"})
|
||||
|
||||
end
|
||||
{
|
||||
"stevearc/oil.nvim",
|
||||
opt = {
|
||||
default_file_explorer = false
|
||||
},
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons'
|
||||
},
|
||||
config = function ()
|
||||
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc= "Open parent directory"})
|
||||
end
|
||||
}
|
||||
}
|
||||
|
@ -6,15 +6,7 @@ return {
|
||||
{'nvim-lua/plenary.nvim'},
|
||||
{
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
build = function () if os == 'Windows_NT' then
|
||||
print("You are on Windows, Idiot!!!")
|
||||
return [[
|
||||
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release
|
||||
&& cmake --build build --config Release
|
||||
&& cmake --install build --prefix build
|
||||
]] else
|
||||
return 'make' end
|
||||
end,
|
||||
build ="cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
|
||||
}
|
||||
},
|
||||
config = function()
|
||||
@ -22,8 +14,15 @@ return {
|
||||
require('telescope').load_extension('fzf')
|
||||
local builtin = require('telescope.builtin')
|
||||
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>fs', builtin.git_files, {})
|
||||
vim.keymap.set('n', '<leader>fd', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>ft', builtin.git_files, {})
|
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags)
|
||||
vim.keymap.set('n', '<leader>fb', builtin.buffers)
|
||||
vim.keymap.set('n', '<leader>/', builtin.current_buffer_fuzzy_find)
|
||||
vim.keymap.set('n', '<leader>gw', builtin.grep_string)
|
||||
vim.keymap.set('n', '<leader>fp',function ()
|
||||
builtin.find_files { cwd = "~/AppData/Local/nvim/lua/barink/"}
|
||||
end)
|
||||
end
|
||||
}
|
||||
}
|
||||
|
30
lua/barink/plugins/theme.lua
Normal file
30
lua/barink/plugins/theme.lua
Normal file
@ -0,0 +1,30 @@
|
||||
-- return {
|
||||
-- "folke/tokyonight.nvim",
|
||||
-- lazy = false,
|
||||
-- priority = 1000,
|
||||
-- opts = {},
|
||||
-- config = function()
|
||||
-- require("tokyonight").setup({
|
||||
-- style = "night",
|
||||
-- light_style = "day",
|
||||
-- transparent = true,
|
||||
-- terminal_colors = true,
|
||||
-- dim_inactive = false,
|
||||
-- lualine_bold = false,
|
||||
-- })
|
||||
--
|
||||
-- vim.cmd [[colorscheme tokyonight]]
|
||||
-- end
|
||||
-- }
|
||||
|
||||
return {
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
name="catppuccin",
|
||||
priority=1000,
|
||||
config = function ()
|
||||
require("catppuccin").setup()
|
||||
vim.cmd.colorscheme('catppuccin')
|
||||
end
|
||||
}
|
||||
}
|
8
lua/barink/plugins/todo-comments.lua
Normal file
8
lua/barink/plugins/todo-comments.lua
Normal file
@ -0,0 +1,8 @@
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim"
|
||||
},
|
||||
opts = {
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
return {
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
opts = {},
|
||||
config = function()
|
||||
require("tokyonight").setup({
|
||||
style = "night",
|
||||
light_style = "day",
|
||||
transparent = true,
|
||||
terminal_colors = true,
|
||||
dim_inactive = false,
|
||||
lualine_bold = false,
|
||||
})
|
||||
|
||||
vim.cmd [[colorscheme tokyonight]]
|
||||
end
|
||||
}
|
@ -1,14 +1,33 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-treesitter/playground",
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require 'nvim-treesitter.install'.compilers = {'clang'}
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
|
||||
configs.setup({
|
||||
ensure_installed = { "c", "lua", "vim", "vimdoc", "bash" },
|
||||
playground = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
updatetime = 25,
|
||||
keybindings = {
|
||||
toggle_query_editor = 'o',
|
||||
toggle_hl_groups = 'i',
|
||||
update = 'R',
|
||||
show_help = '?'
|
||||
}
|
||||
},
|
||||
ensure_installed = { "python", "c", "lua", "vim", "vimdoc", "bash" },
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end
|
||||
}
|
||||
},
|
||||
}
|
||||
|
6
lua/barink/plugins/twilight.lua
Normal file
6
lua/barink/plugins/twilight.lua
Normal file
@ -0,0 +1,6 @@
|
||||
return {
|
||||
{
|
||||
"folke/twilight.nvim",
|
||||
opts = {}
|
||||
}
|
||||
}
|
@ -1 +1,6 @@
|
||||
return { "mbbill/undotree" }
|
||||
return {
|
||||
"mbbill/undotree",
|
||||
config = function ()
|
||||
vim.keymap.set('n', '<leader><f1>', vim.cmd.UndotreeToggle)
|
||||
end
|
||||
}
|
||||
|
@ -1,4 +1,9 @@
|
||||
return {
|
||||
<<<<<<< HEAD
|
||||
'tpope/vim-dadbod',
|
||||
}
|
||||
|
||||
=======
|
||||
"tpope/vim-dadbod",
|
||||
}
|
||||
>>>>>>> Windows
|
||||
|
4
lua/barink/plugins/vimbegood.lua
Normal file
4
lua/barink/plugins/vimbegood.lua
Normal file
@ -0,0 +1,4 @@
|
||||
return {
|
||||
'ThePrimeagen/vim-be-good',
|
||||
}
|
||||
|
15
lua/barink/plugins/which-key.lua
Normal file
15
lua/barink/plugins/which-key.lua
Normal file
@ -0,0 +1,15 @@
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>?",
|
||||
function()
|
||||
require("which-key").show({global = false})
|
||||
end,
|
||||
desc = "Buffer Local Keymaps (which-key)",
|
||||
}
|
||||
}
|
||||
}
|
4
lua/barink/plugins/zen-mode.lua
Normal file
4
lua/barink/plugins/zen-mode.lua
Normal file
@ -0,0 +1,4 @@
|
||||
return {
|
||||
"folke/zen-mode.nvim",
|
||||
opts = {}
|
||||
}
|
15
lua/barink/snippets/all.lua
Normal file
15
lua/barink/snippets/all.lua
Normal file
@ -0,0 +1,15 @@
|
||||
local ls = require("luasnip")
|
||||
|
||||
local s = ls.snippet
|
||||
local t = ls.text_node
|
||||
|
||||
-- https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md
|
||||
return {
|
||||
s("novel", {
|
||||
t("It was a dark and stormy night on")
|
||||
}),
|
||||
|
||||
s("no", {
|
||||
t("hello world!")
|
||||
}),
|
||||
}
|
23
lua/barink/snippets/java.lua
Normal file
23
lua/barink/snippets/java.lua
Normal file
@ -0,0 +1,23 @@
|
||||
local ls = require("luasnip")
|
||||
|
||||
local s = ls.snippet
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
|
||||
-- https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md
|
||||
return {
|
||||
s(
|
||||
"main",
|
||||
fmt([[
|
||||
static void main (){{
|
||||
{a}
|
||||
}}
|
||||
]],
|
||||
{a = i(1)}
|
||||
)),
|
||||
s("sout", fmt("System.out.println(\"{}\");", { i(1, "My message")})),
|
||||
s("soutm", t("System.out.println(\"$CLASS_NAME$.$METHOD_NAME$\");")),
|
||||
s("soutp", t("System.out.println(\"$FORMAT$\");")),
|
||||
s("soutv", t("System.out.println(\"$EXPR_COPY$ = \" + $EXPR$);")),
|
||||
}
|
11
lua/barink/snippets/lua.lua
Normal file
11
lua/barink/snippets/lua.lua
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
local ls = require("luasnip")
|
||||
|
||||
local s = ls.snippet
|
||||
local i = ls.insert_node
|
||||
local fmt = require("luasnip.extras.fmt").fmt
|
||||
|
||||
-- https://github.com/L3MON4D3/LuaSnip/blob/master/DOC.md
|
||||
return {
|
||||
s("req", fmt("local {} = require('{}')", { i(1, "default"), require("luasnip.extras").rep(1)}))
|
||||
}
|
@ -35,3 +35,15 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
||||
end,
|
||||
})
|
||||
|
||||
--[[
|
||||
-- Run zig test on save
|
||||
-- TODO: fix vim.cmd call
|
||||
-- TODO: only do this when a zig test file is open
|
||||
vim.api.nvim_create_autocmd('BufWritePost' , {
|
||||
callback = function ()
|
||||
vim.cmd{cmd = '!zig' , args= {'test', vim.fn.expand('%')} }
|
||||
end
|
||||
})]]--
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user