1
0
Fork 0

FEAT: conform and oil added

Changes
- Removed hardtime ( messages were too annoying)
- Cleaned up key mappings file
- Disabled Lazy loading
- Added Oil and conform
main
Nigel Barink 2024-05-28 21:11:34 +02:00
parent 0d5552904c
commit 430a2879e9
Signed by: Nigel
GPG Key ID: C54278C495538619
7 changed files with 255 additions and 205 deletions

View File

@ -3,35 +3,36 @@
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, "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": "1ba38e4cbb24683973e00c2e36f53ae64da38ef5" }, "conform.nvim": { "branch": "master", "commit": "f3b930db4964d60e255c8f9e37b7f2218dfc08cb" },
"gen.nvim": { "branch": "main", "commit": "87fbe811155b90eea58622614809705b966009ad" }, "fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" },
"gen.nvim": { "branch": "main", "commit": "bd19cf584b5b82123de977b44105e855e61e5f39" },
"git-worktree.nvim": { "branch": "master", "commit": "f247308e68dab9f1133759b05d944569ad054546" }, "git-worktree.nvim": { "branch": "master", "commit": "f247308e68dab9f1133759b05d944569ad054546" },
"hardtime.nvim": { "branch": "main", "commit": "eaf4bc31b86419c26ad7b3a142dd36ca545ca2e4" },
"harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" },
"lazy.nvim": { "branch": "main", "commit": "3f13f080434ac942b150679223d54f5ca91e0d52" }, "lazy.nvim": { "branch": "main", "commit": "24fa2a97085ca8a7220b5b078916f81e316036fd" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"mason-lspconfig": { "branch": "main", "commit": "273fdde8ac5e51f3a223ba70980e52bbc09d9f6f" }, "mason-lspconfig": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" },
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, "mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" },
"nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" },
"nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, "nvim-dap": { "branch": "master", "commit": "abb238f631609ea4be496ba7946f4f3aaec86c6a" },
"nvim-dap": { "branch": "master", "commit": "6ae8a14828b0f3bff1721a35a1dfd604b6a933bb" }, "nvim-dap-ui": { "branch": "master", "commit": "b7267003ba4dd860350be86f75b9d9ea287cedca" },
"nvim-dap-ui": { "branch": "master", "commit": "edfa93f60b189e5952c016eee262d0685d838450" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "d7c695ea39542f6da94ee4d66176f5d660ab0a77" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "3e8e207513e6ef520894950acd76b79902714103" },
"nvim-emmet": { "branch": "main", "commit": "928cfb74ed436d6d326ccab2061cf3592de1bf55" }, "nvim-emmet": { "branch": "main", "commit": "928cfb74ed436d6d326ccab2061cf3592de1bf55" },
"nvim-highlight-colors": { "branch": "main", "commit": "432dc7a817a4973041f02b418169667c491f60fd" }, "nvim-highlight-colors": { "branch": "main", "commit": "582064092cff170331064b7d198a5b97cb261fca" },
"nvim-jdtls": { "branch": "master", "commit": "8eb5f0dbe6e126b392ddcaf45893358619893e45" }, "nvim-jdtls": { "branch": "master", "commit": "10691312d51c5485c656a71258b55d3798d3fb3e" },
"nvim-lspconfig": { "branch": "master", "commit": "7133e85c3df14a387da8942c094c7edddcdef309" }, "nvim-lspconfig": { "branch": "master", "commit": "38de86f82efd9ba0881203767d6a8e1815abca28" },
"nvim-nio": { "branch": "master", "commit": "5800f585def265d52f1d8848133217c800bcb25d" }, "nvim-nio": { "branch": "master", "commit": "632024157d01e8bc48fd7df6a7de8ffe3fdd4f3a" },
"nvim-treesitter": { "branch": "master", "commit": "a95de26cd75a04df9283e0af1fd38f001238eb25" }, "nvim-treesitter": { "branch": "master", "commit": "ea2b137f35fb1e87a6471ec311805920fdf45745" },
"nvim-web-devicons": { "branch": "master", "commit": "27eac98fd6675d29d0e19d4d0622fd7a3968483a" }, "nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" },
"plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, "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": "master", "commit": "35f94f0ef32d70e3664a703cefbe71bd1456d899" }, "telescope.nvim": { "branch": "master", "commit": "2df52609a1632de5d77a0b2416db6ad9cf32e463" },
"tokyonight.nvim": { "branch": "main", "commit": "67afeaf7fd6ebba000633e89f63c31694057edde" }, "tokyonight.nvim": { "branch": "main", "commit": "0fae425aaab04a5f97666bd431b96f2f19c36935" },
"trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, "trouble.nvim": { "branch": "main", "commit": "a8264a65a0b894832ea642844f5b7c30112c458f" },
"undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" },
"vim-dadbod": { "branch": "master", "commit": "960bbb7de11b7282a68d579a64e838b487934493" }, "vim-dadbod": { "branch": "master", "commit": "fb30422b7bee7e2fa4205a4d226f01477f4fc593" },
"vim-fugitive": { "branch": "master", "commit": "dac8e5c2d85926df92672bf2afb4fc48656d96c7" } "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 -- Move lines while in visual mode
vim.keymap.set('n', '<leader>x', function() print("sorry this is windows!") end) vim.keymap.set("v", "<A-S-j>", ":m '>+1<CR>gv=gv", { noremap = true })
elseif osname == "Linux" then vim.keymap.set("v", "<A-S-k>", ":m '<-2<CR>gv=gv", { noremap = true })
-- Linux only!!
vim.keymap.set('n', '<leader>x', "<cmd>!chmod +x %<CR>", { silent = true })
end
-- 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 -- 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,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

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

View File

@ -1,145 +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",
"olrtg/nvim-emmet", config = function()
config = function() vim.keymap.set({ "n", "v" }, "<leader>xe", require("nvim-emmet").wrap_with_abbreviation)
vim.keymap.set({ "n", "v" }, '<leader>xe', require('nvim-emmet').wrap_with_abbreviation) end,
end, },
} },
}, config = function()
config = function() require("mason").setup()
require("mason").setup() require("mason-lspconfig").setup({
require("mason-lspconfig").setup({ ensure_installed = { "lua_ls", "bashls", "rust_analyzer" },
ensure_installed = { "lua_ls", "bashls", "rust_analyzer" } })
}) local cmp = require("cmp")
local cmp = require('cmp') cmp.setup({
cmp.setup({ snippet = {
snippet = { expand = function(args)
expand = function(args) require("luasnip").lsp_expand(args.body)
require('luasnip').lsp_expand(args.body) end,
end, },
}, mapping = cmp.mapping.preset.insert({
mapping = cmp.mapping.preset.insert({ ["<C-b>"] = cmp.mapping.scroll_docs(-4),
['<C-b>'] = cmp.mapping.scroll_docs(-4), ["<C-f>"] = cmp.mapping.scroll_docs(4),
['<C-f>'] = cmp.mapping.scroll_docs(4), ["<C-Space>"] = cmp.mapping.complete(),
['<C-Space>'] = cmp.mapping.complete(), ["<C-e>"] = cmp.mapping.abort(),
['<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.
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. }),
}), sources = cmp.config.sources({
sources = cmp.config.sources({ { name = "path" },
{ name = 'path' }, { name = "nvim_lsp", keyword_length = 1 },
{ name = 'nvim_lsp', keyword_length = 1 }, { name = "luasnip", option = { show_autosnippets = true } },
{ name = 'luasnip', option = { show_autosnippets = true}}, }, {
}, { { name = "buffer", keyword_length = 2 },
{ name = 'buffer', keyword_length = 2 }, }),
}), window = {
window = { documentation = cmp.config.window.bordered(),
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.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,
})
lsp.lua_ls.setup({ vim.keymap.set({ "i", "s" }, "<C-K>", function()
capabilities = require('cmp_nvim_lsp').default_capabilities(), ls.expand()
settings = { end, { silent = true })
Lua = { vim.keymap.set({ "i", "s" }, "<C-L>", function()
diagnostics = { ls.jump(1)
globals = { 'vim' } 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()
local ls = require("luasnip") if ls.choice_active() then
ls.config.set_config({ ls.change_choice(1)
history = true, end
updateevents = "TextChanged, TextChangedI", end, { silent = true })
enable_autosnippets = true,
})
vim.keymap.set({"i", "s"}, "<C-K>", function() ls.expand() end, {silent = true}) require("luasnip.loaders.from_lua").load({ paths = "C:\\Users\\nigel\\AppData\\Local\\nvim\\lua\\snippets" })
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= "C:\\Users\\nigel\\AppData\\Local\\nvim\\lua\\snippets"}) -- Set up lspconfig.
local capabilities = require("cmp_nvim_lsp").default_capabilities()
-- Set up lspconfig. require("lspconfig")["asm_lsp"].setup({
local capabilities = require('cmp_nvim_lsp').default_capabilities() capabilities = capabilities,
})
require('lspconfig')['asm_lsp'].setup({ require("lspconfig")["zls"].setup({
capabilities = capabilities capabilities = capabilities,
}) })
require('lspconfig')['zls'].setup({ require("lspconfig")["rust_analyzer"].setup({
capabilities = capabilities capabilities = capabilities,
}) })
require('lspconfig')['rust_analyzer'].setup({ require("lspconfig")["jdtls"].setup({
capabilities = capabilities capabilities = capabilities,
}) })
require('lspconfig')['jdtls'].setup({ require("lspconfig")["bashls"].setup({
capabilities = capabilities capabilities = capabilities,
}) })
require('lspconfig')['bashls'].setup({
capabilities = capabilities
})
require('lspconfig')['gopls'].setup({
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
}