1
0

Compare commits

...

5 Commits

Author SHA1 Message Date
430a2879e9 FEAT: conform and oil added
Changes
- Removed hardtime ( messages were too annoying)
- Cleaned up key mappings file
- Disabled Lazy loading
- Added Oil and conform
2024-05-28 21:11:34 +02:00
0d5552904c FEAT: Added dadbod
A DB editor inside vim/neovim
2024-05-09 20:15:26 +02:00
d8d6365bee FEAT: Adding Git-Worktree and commit plugin. 2024-04-28 11:10:29 +02:00
e9488d5948 FEAT: Added emmet 2024-04-14 15:35:48 +02:00
0c2a2236a5 FEAT: Add Colour highlighting 2024-04-09 18:20:29 +02:00
11 changed files with 296 additions and 198 deletions

View File

@ -1,32 +1,38 @@
{ {
"LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" }, "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"fidget.nvim": { "branch": "main", "commit": "933db4596e4bab1b09b6d48a10e21819e4cc458f" }, "conform.nvim": { "branch": "master", "commit": "f3b930db4964d60e255c8f9e37b7f2218dfc08cb" },
"gen.nvim": { "branch": "main", "commit": "87fbe811155b90eea58622614809705b966009ad" }, "fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" },
"hardtime.nvim": { "branch": "main", "commit": "21b0f9146198bb43fbc9f5ec66c8af3234f278ed" }, "gen.nvim": { "branch": "main", "commit": "bd19cf584b5b82123de977b44105e855e61e5f39" },
"harpoon": { "branch": "harpoon2", "commit": "a38be6e0dd4c6db66997deab71fc4453ace97f9c" }, "git-worktree.nvim": { "branch": "master", "commit": "f247308e68dab9f1133759b05d944569ad054546" },
"lazy.nvim": { "branch": "main", "commit": "3132d7d27d56d6bb4bdd0a09623d162b3cf1c588" }, "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" },
"lualine.nvim": { "branch": "master", "commit": "b5e8bb642138f787a2c1c5aedc2a78cb2cebbd67" }, "lazy.nvim": { "branch": "main", "commit": "24fa2a97085ca8a7220b5b078916f81e316036fd" },
"mason-lspconfig": { "branch": "main", "commit": "9dfcf2036c223920826140f0151d929a43f9eceb" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, "mason-lspconfig": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" },
"nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, "mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" },
"nvim-cmp": { "branch": "main", "commit": "6ed1c93465c33f6a53b4c3f103bf9d1ab696382a" }, "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" },
"nvim-dap": { "branch": "master", "commit": "405df1dcc2e395ab5173a9c3d00e03942c023074" }, "nvim-dap": { "branch": "master", "commit": "abb238f631609ea4be496ba7946f4f3aaec86c6a" },
"nvim-dap-ui": { "branch": "master", "commit": "edfa93f60b189e5952c016eee262d0685d838450" }, "nvim-dap-ui": { "branch": "master", "commit": "b7267003ba4dd860350be86f75b9d9ea287cedca" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "baa5b0dc6663284cce32e0d00ac1f2511b13496f" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "d7c695ea39542f6da94ee4d66176f5d660ab0a77" },
"nvim-jdtls": { "branch": "master", "commit": "8eb5f0dbe6e126b392ddcaf45893358619893e45" }, "nvim-emmet": { "branch": "main", "commit": "928cfb74ed436d6d326ccab2061cf3592de1bf55" },
"nvim-lspconfig": { "branch": "master", "commit": "24662f92c18edd397ef12d635b11dbdedef2d094" }, "nvim-highlight-colors": { "branch": "main", "commit": "582064092cff170331064b7d198a5b97cb261fca" },
"nvim-nio": { "branch": "master", "commit": "33c62b3eadd8154169e42144de16ba4db6784bec" }, "nvim-jdtls": { "branch": "master", "commit": "10691312d51c5485c656a71258b55d3798d3fb3e" },
"nvim-treesitter": { "branch": "master", "commit": "a951dcb7ec253544b0150251008de8b06a0874cd" }, "nvim-lspconfig": { "branch": "master", "commit": "38de86f82efd9ba0881203767d6a8e1815abca28" },
"nvim-web-devicons": { "branch": "master", "commit": "3ee60deaa539360518eaab93a6c701fe9f4d82ef" }, "nvim-nio": { "branch": "master", "commit": "632024157d01e8bc48fd7df6a7de8ffe3fdd4f3a" },
"plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" }, "nvim-treesitter": { "branch": "master", "commit": "ea2b137f35fb1e87a6471ec311805920fdf45745" },
"nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" },
"oil.nvim": { "branch": "master", "commit": "2cb39e838e9dcd8b374f09a3a87a2e5ec9d372f6" },
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
"telescope.nvim": { "branch": "0.1.x", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, "telescope.nvim": { "branch": "master", "commit": "2df52609a1632de5d77a0b2416db6ad9cf32e463" },
"tokyonight.nvim": { "branch": "main", "commit": "fbe3a27378fdd51a8ddd04f57012455436916a62" }, "tokyonight.nvim": { "branch": "main", "commit": "0fae425aaab04a5f97666bd431b96f2f19c36935" },
"trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, "trouble.nvim": { "branch": "main", "commit": "a8264a65a0b894832ea642844f5b7c30112c458f" },
"undotree": { "branch": "master", "commit": "aa93a7e5890dbbebbc064cd22260721a6db1a196" }, "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" },
"vim-fugitive": { "branch": "master", "commit": "2377e16e6641418565b934990cf49068855987c6" } "vim-dadbod": { "branch": "master", "commit": "fb30422b7bee7e2fa4205a4d226f01477f4fc593" },
"vim-fugitive": { "branch": "master", "commit": "4f59455d2388e113bd510e85b310d15b9228ca0d" },
"vim-tabby": { "branch": "main", "commit": "afd76df166ed0f223ede1071e0cfde8075cc4a24" }
} }

View File

@ -3,15 +3,23 @@ require("barink.keys")
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ vim.fn.system({
"git", "git",
"clone", "clone",
"--filter=blob:none", "--filter=blob:none",
"https://github.com/folke/lazy.nvim.git", "https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release "--branch=stable", -- latest stable release
lazypath, lazypath,
}) })
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
local opts = {
require("lazy").setup("barink.plugins") defaults = {
lazy = false,
},
change_detection = {
enabled = true,
notify = false,
},
}
require("lazy").setup("barink.plugins", opts)

View File

@ -1,42 +1,54 @@
-- Keymaps -- Keymaps
vim.g.mapleader = " " vim.g.mapleader = " "
vim.keymap.set('n', '<leader><F8>', vim.cmd.UndotreeToggle) vim.keymap.set("n", "<leader><F8>", vim.cmd.UndotreeToggle)
vim.keymap.set('n', '<leader>p', [["_dP]]) vim.keymap.set("n", "<leader>p", [["_dP]])
vim.keymap.set('n', '<leader>fa', vim.lsp.buf.format) vim.keymap.set("n", "<leader>fa", vim.lsp.buf.format)
vim.keymap.set('n', '<leader>m', ":Mason<CR>") 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>e", ":Explore<CR>", { noremap = false, silent = true })
vim.keymap.set('n', '<leader>le',':Lexplore<CR>', {noremap = false, silent=true}) vim.keymap.set("n", "<leader>le", ":Lexplore<CR>", { noremap = false, silent = true })
local osname = vim.loop.os_uname().sysname vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true })
if osname == "Windows_NT" then
vim.keymap.set('n', '<leader>x', function() print("sorry this is windows!") end)
elseif osname == "Linux" then
-- Linux only!!
vim.keymap.set('n', '<leader>x', "<cmd>!chmod +x %<CR>", { silent = true })
end
-- Move lines while in visual mode -- 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-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("v", "<A-S-k>", ":m '<-2<CR>gv=gv", { noremap = true })
-- Move lines while in normal mode -- Move lines while in normal mode
vim.keymap.set('n', '<A-S-j>', ':m .+1<CR>==', {noremap = true}) vim.keymap.set("n", "<A-S-j>", ":m .+1<CR>==", { noremap = true })
vim.keymap.set('n', '<A-S-k>', ':m .-2<CR>==', {noremap = true}) vim.keymap.set("n", "<A-S-k>", ":m .-2<CR>==", { noremap = true })
-- Move line in edit mode -- Move line in edit mode
vim.keymap.set('i', '<A-j>', ':m .+1<CR>==gi', {noremap = true}) vim.keymap.set("i", "<A-j>", ":m .+1<CR>==gi", { noremap = true })
vim.keymap.set('i', '<A-k>', ':m .-2<CR>==gi', {noremap = true}) vim.keymap.set("i", "<A-k>", ":m .-2<CR>==gi", { noremap = true })
-- Diagnostics ! -- Diagnostics !
vim.keymap.set('n', '<C-T>', function() require('trouble').toggle() end ) vim.keymap.set("n", "<C-T>", function()
vim.keymap.set('n', '<leader>d', function () vim.diagnostic.open_float() end ) require("trouble").toggle()
vim.keymap.set('n', '<leader>dn', function () vim.diagnostic.goto_next() end ) end)
vim.keymap.set('n', '<leader>dp', function () vim.diagnostic.goto_prev() 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)
-- Debugging -- Debugging
vim.keymap.set('n', '<leader>sb', function () require('dap').toggle_breakpoint() end ) vim.keymap.set("n", "<leader>sb", function()
vim.keymap.set('n', '<leader>db', function () require('dapui').toggle() end ) require("dap").toggle_breakpoint()
vim.keymap.set('n', '<F5>', function () print("Start debug session" ) require('dap').continue() end ) end)
vim.keymap.set('n', '<F6>', function () require('dap').step_over() end ) vim.keymap.set("n", "<leader>db", function()
vim.keymap.set('n', '<F7>', function () require('dap').step_into() end ) require("dapui").toggle()
end)
vim.keymap.set("n", "<F5>", function()
require("dap").continue()
end)
vim.keymap.set("n", "<F6>", function()
require("dap").step_over()
end)
vim.keymap.set("n", "<F7>", function()
require("dap").step_into()
end)
vim.keymap.set('n', '<leader>=',":Gen Generate<CR>") vim.keymap.set("n", "<leader>=", ":Gen Generate<CR>")

View File

@ -0,0 +1,11 @@
return {
'numToStr/Comment.nvim',
opts = {
-- add any options here
},
config = function ()
require("Comment").setup()
end,
lazy = false,
}

View File

@ -0,0 +1,18 @@
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,
}

View File

@ -0,0 +1,10 @@
return {
'ThePrimeagen/git-worktree.nvim',
dependencies = {
'nvim-telescope/telescope.nvim'
},
init = function()
require("git-worktree").setup()
require("telescope").load_extension("git_worktree")
end
}

View File

@ -1,9 +0,0 @@
return {
{
'm4xshen/hardtime.nvim',
dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim"},
opts = {
restriction_mode = "hint"
}
}
}

View File

@ -0,0 +1,9 @@
return {
{
'brenoprata10/nvim-highlight-colors',
config = function ()
vim.opt.termguicolors = true
require("nvim-highlight-colors").setup({})
end
}
}

View File

@ -1,136 +1,151 @@
return return {
{ "neovim/nvim-lspconfig",
'neovim/nvim-lspconfig', dependencies = {
dependencies = { "williamboman/mason-lspconfig",
"williamboman/mason-lspconfig", "williamboman/mason.nvim",
"williamboman/mason.nvim", "hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer",
"hrsh7th/cmp-buffer", "hrsh7th/cmp-path",
"hrsh7th/cmp-path", "hrsh7th/cmp-cmdline",
"hrsh7th/cmp-cmdline", "hrsh7th/nvim-cmp",
"hrsh7th/nvim-cmp", {
{ "L3MON4D3/LuaSnip",
'L3MON4D3/LuaSnip', dependencies = "hrsh7th/nvim-cmp",
dependencies = 'hrsh7th/nvim-cmp', version = "v2.*",
version = "v2.*", },
}, { "mfussenegger/nvim-jdtls", dependencies = { "nvim-dap" } },
{'mfussenegger/nvim-jdtls', dependencies = {'nvim-dap'}}, {
}, "olrtg/nvim-emmet",
config = function() config = function()
require("mason").setup() vim.keymap.set({ "n", "v" }, "<leader>xe", require("nvim-emmet").wrap_with_abbreviation)
require("mason-lspconfig").setup({ end,
ensure_installed = { "lua_ls", "bashls", "rust_analyzer" } },
}) },
local cmp = require('cmp') config = function()
cmp.setup({ require("mason").setup()
snippet = { require("mason-lspconfig").setup({
expand = function(args) ensure_installed = { "lua_ls", "bashls", "rust_analyzer" },
require('luasnip').lsp_expand(args.body) })
end, local cmp = require("cmp")
}, cmp.setup({
mapping = cmp.mapping.preset.insert({ snippet = {
['<C-b>'] = cmp.mapping.scroll_docs(-4), expand = function(args)
['<C-f>'] = cmp.mapping.scroll_docs(4), require("luasnip").lsp_expand(args.body)
['<C-Space>'] = cmp.mapping.complete(), end,
['<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. mapping = cmp.mapping.preset.insert({
}), ["<C-b>"] = cmp.mapping.scroll_docs(-4),
sources = cmp.config.sources({ ["<C-f>"] = cmp.mapping.scroll_docs(4),
{ name = 'path' }, ["<C-Space>"] = cmp.mapping.complete(),
{ name = 'nvim_lsp', keyword_length = 1 }, ["<C-e>"] = cmp.mapping.abort(),
{ name = 'luasnip', option = { show_autosnippets = true}}, ["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}, { }),
{ name = 'buffer', keyword_length = 2 }, sources = cmp.config.sources({
}), { name = "path" },
window = { { name = "nvim_lsp", keyword_length = 1 },
documentation = cmp.config.window.bordered() { name = "luasnip", option = { show_autosnippets = true } },
}, }, {
{ name = "buffer", keyword_length = 2 },
}),
window = {
documentation = cmp.config.window.bordered(),
},
})
}) -- Set configuration for specific filetype.
cmp.setup.filetype("gitcommit", {
sources = cmp.config.sources({
{ name = "git" }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
}, {
{ name = "buffer" },
}),
})
-- Set configuration for specific filetype. -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.filetype('gitcommit', { cmp.setup.cmdline({ "/", "?" }, {
sources = cmp.config.sources({ mapping = cmp.mapping.preset.cmdline(),
{ name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git). sources = {
}, { { name = "buffer" },
{ name = 'buffer' }, },
}) })
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, { cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = { sources = cmp.config.sources({
{ name = 'buffer' } { name = "path" },
} }, {
}) { name = "cmdline" },
}),
matching = { disallow_symbol_nonprefix_matching = false },
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). local lsp = require("lspconfig")
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
}),
matching = { disallow_symbol_nonprefix_matching = false }
})
local lsp = require("lspconfig") lsp.emmet_language_server.setup({})
lsp.lua_ls.setup({
capabilities = require('cmp_nvim_lsp').default_capabilities(),
settings = {
Lua = {
diagnostics = {
globals = { 'vim' }
}
}
}
})
local ls = require("luasnip")
ls.config.set_config({
history = true,
updateevents = "TextChanged, TextChangedI",
enable_autosnippets = true,
})
vim.keymap.set({"i", "s"}, "<C-K>", function() ls.expand() end, {silent = true}) lsp.lua_ls.setup({
vim.keymap.set({"i", "s"}, "<C-L>", function() ls.jump(1) end, {silent = true }) capabilities = require("cmp_nvim_lsp").default_capabilities(),
vim.keymap.set({"i", "s"}, "<C-J>", function() ls.jump(-1) end, {silent = true}) settings = {
vim.keymap.set({"i", "s"}, "<C-E>", function() Lua = {
if ls.choice_active() then diagnostics = {
ls.change_choice(1) globals = { "vim" },
end },
end, {silent = true}) },
},
})
local ls = require("luasnip")
ls.config.set_config({
history = true,
updateevents = "TextChanged, TextChangedI",
enable_autosnippets = true,
})
require("luasnip.loaders.from_lua").load({paths= "C:\\Users\\nigel\\AppData\\Local\\nvim\\lua\\snippets"}) 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 })
-- Set up lspconfig. require("luasnip.loaders.from_lua").load({ paths = "C:\\Users\\nigel\\AppData\\Local\\nvim\\lua\\snippets" })
local capabilities = require('cmp_nvim_lsp').default_capabilities()
require('lspconfig')['asm_lsp'].setup({ -- Set up lspconfig.
capabilities = capabilities local capabilities = require("cmp_nvim_lsp").default_capabilities()
})
require('lspconfig')['zls'].setup({ require("lspconfig")["asm_lsp"].setup({
capabilities = capabilities capabilities = capabilities,
}) })
require('lspconfig')['rust_analyzer'].setup({ require("lspconfig")["zls"].setup({
capabilities = capabilities capabilities = capabilities,
}) })
require('lspconfig')['jdtls'].setup({ require("lspconfig")["rust_analyzer"].setup({
capabilities = capabilities capabilities = capabilities,
}) })
require('lspconfig')['bashls'].setup({ require("lspconfig")["jdtls"].setup({
capabilities = capabilities capabilities = capabilities,
}) })
require('lspconfig')['gopls'].setup({ require("lspconfig")["bashls"].setup({
capabilities = capabilities capabilities = capabilities,
}) })
end
}
require("lspconfig")["tsserver"].setup({
capabilities = capabilities,
})
require("lspconfig")["gopls"].setup({
capabilities = capabilities,
})
end,
}

View File

@ -0,0 +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
}

View File

@ -0,0 +1,4 @@
return {
'tpope/vim-dadbod',
}