From 6fe0af5b061ed44fa0065f29eebe2ea184f9ae98 Mon Sep 17 00:00:00 2001 From: jkluwa Date: Thu, 18 Jun 2026 00:54:42 +0200 Subject: [PATCH] add oil.nvim --- init.lua | 11 ++++++ lua/custom/plugins/init.lua | 1 + lua/custom/plugins/lazygit.lua | 10 ++++++ lua/custom/plugins/oil.lua | 61 ++++++++++++++++++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 lua/custom/plugins/lazygit.lua create mode 100644 lua/custom/plugins/oil.lua diff --git a/init.lua b/init.lua index 9c7cbb5b..b025fcf5 100644 --- a/init.lua +++ b/init.lua @@ -673,6 +673,7 @@ require('lazy').setup({ -- clangd = {}, -- gopls = {}, pyright = {}, + -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- @@ -1018,3 +1019,13 @@ require('lazy').setup({ -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et +vim.api.nvim_create_autocmd('FileType', { + pattern = 'cs', + callback = function() + vim.lsp.start { + name = 'csharp_ls', + cmd = { 'csharp-ls' }, + root_dir = vim.fs.root(0, { '.sln', '.git' }), + } + end, +}) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 7872cf32..dfc36266 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -57,6 +57,7 @@ return { end, cwd = '${workspaceFolder}', stopOnEntry = false, + console = 'internalTerminal', args = {}, }, } diff --git a/lua/custom/plugins/lazygit.lua b/lua/custom/plugins/lazygit.lua new file mode 100644 index 00000000..b2610b00 --- /dev/null +++ b/lua/custom/plugins/lazygit.lua @@ -0,0 +1,10 @@ +return { + 'kdheepak/lazygit.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + }, + -- Lazy-loading: wtyczka ładuje się dopiero, gdy wciśniesz skrót + keys = { + { 'gg', 'LazyGit', desc = 'Otwórz [G]it [G]UI (LazyGit)' }, + }, +} diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua new file mode 100644 index 00000000..a1ce951f --- /dev/null +++ b/lua/custom/plugins/oil.lua @@ -0,0 +1,61 @@ +return { + 'stevearc/oil.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + require('oil').setup { + -- Podstawowa konfiguracja + default_file_explorer = true, -- Zastępuje domyślnego Netrw (wbudowany explorer w Vima) + + -- Wygląd i kolumny + columns = { + 'icon', + -- "permissions", + -- "size", + -- "mtime", + }, + + -- Zachowanie buforów + buf_options = { + buflisted = false, + bufhidden = 'hide', + }, + + -- Ukrywanie plików .gitignore + view_options = { + show_hidden = false, -- domyślnie nie pokazuj ukrytych plików (użyj g. aby przełączyć) + is_hidden_file = function(name, bufnr) + return vim.startswith(name, '.') + end, + is_always_hidden = function(name, bufnr) + return name == '..' + end, + }, + + -- Mapowania klawiszy wewnątrz Oil + keymaps = { + ['g?'] = 'actions.show_help', + [''] = 'actions.select', + [''] = 'actions.select_vsplit', -- Otwórz w podziale pionowym + [''] = 'actions.select_split', -- Otwórz w podziale poziomym + [''] = 'actions.select_tab', -- Otwórz w nowej karcie + [''] = 'actions.preview', -- Podgląd + [''] = 'actions.close', -- Zamknij + [''] = 'actions.refresh', -- Odśwież + ['-'] = 'actions.parent', -- Przejdź katalog wyżej + ['_'] = 'actions.open_cwd', -- Otwórz aktualny katalog roboczy + ['`'] = 'actions.cd', -- Zmień aktualny katalog roboczy (CWD) + ['~'] = 'actions.tcd', -- Zmień CWD tylko dla aktualnej karty + ['gs'] = 'actions.change_sort', -- Zmień sortowanie + ['gx'] = 'actions.open_external', -- Otwórz w zewnętrznym programie (np. obrazek w przeglądarce) + ['g.'] = 'actions.toggle_hidden', -- Przełącz ukryte pliki + ['g\\'] = 'actions.toggle_trash', -- Pokaż kosz + }, + + -- Gdzie używać kosza zamiast trwałego usunięcia (wymaga programu 'trash' w systemie) + use_default_keymaps = true, + } + + -- Mapowanie do otwierania Oil z dowolnego miejsca + vim.keymap.set('n', '-', 'Oil', { desc = 'Otwórz folder nadrzędny (Oil)' }) + end, +}