diff options
| -rw-r--r-- | ale.lua | 34 | ||||
| -rw-r--r-- | anki.lua | 19 | ||||
| -rw-r--r-- | autopairs.lua | 42 | ||||
| -rw-r--r-- | comment.lua | 14 | ||||
| -rw-r--r-- | conform.lua | 23 | ||||
| -rw-r--r-- | firenvim.lua | 3 | ||||
| -rw-r--r-- | lspconfig.lua | 28 | ||||
| -rw-r--r-- | luasnip.lua | 10 | ||||
| -rw-r--r-- | mason.lua | 22 | ||||
| -rw-r--r-- | r.lua | 17 | ||||
| -rw-r--r-- | sqlua.lua | 10 | ||||
| -rw-r--r-- | surround.lua | 12 | ||||
| -rw-r--r-- | telescope.lua | 37 | ||||
| -rw-r--r-- | tex.lua | 22 | ||||
| -rw-r--r-- | undotree.lua | 7 | ||||
| -rw-r--r-- | which-key.lua | 18 |
16 files changed, 318 insertions, 0 deletions
@@ -0,0 +1,34 @@ +return { + { + "dense-analysis/ale", + ft = { "*" }, -- load for all filetypes + config = function() + -- Enable ALE linting + vim.g.ale_enabled = 1 + vim.g.ale_lint_on_text_changed = "always" + vim.g.ale_lint_on_insert_leave = 1 + vim.g.ale_sign_error = "✗" + vim.g.ale_sign_warning = "⚠" + vim.g.ale_sign_info = "ℹ" + + -- Fixers + vim.g.ale_fixers = { + python = { "black", "isort" }, + r = { "styler" }, + lua = { "stylua" }, + tex = { "latexindent" }, + } + + -- Automatically fix files on save + vim.g.ale_fix_on_save = 1 + + -- Optional: choose linters per language + vim.g.ale_linters = { + python = { "flake8", "mypy" }, + r = { "lintr" }, + lua = { "luacheck" }, + tex = { "chktex" }, + } + end, + }, +} diff --git a/anki.lua b/anki.lua new file mode 100644 index 0000000..30271e0 --- /dev/null +++ b/anki.lua @@ -0,0 +1,19 @@ +return { + { + "rareitems/anki.nvim", + -- lazy -- don't lazy it, it tries to be as lazy possible and it needs to add a filetype association + opts = { + { + -- this function will add support for associating '.anki' extension with both 'anki' and 'tex' filetype. + tex_support = true, + -- if 'true' it will move the cursor the position of the first field + move_cursor_after_creation = true, + models = { + -- Here you specify which notetype should be associated with which deck + ["Statystyka"] = "Statystyka", + ["Pleco"] = "English", + }, + }, + }, + }, +} diff --git a/autopairs.lua b/autopairs.lua new file mode 100644 index 0000000..97407dc --- /dev/null +++ b/autopairs.lua @@ -0,0 +1,42 @@ +return { + -- nvim-autopairs: auto close brackets, quotes + { + "windwp/nvim-autopairs", + event = "InsertEnter", -- lazy-load when entering insert mode + config = function() + require("nvim-autopairs").setup({}) + end, + }, + + -- nvim-cmp: autocompletion engine + -- { + -- "hrsh7th/nvim-cmp", + -- event = "InsertEnter", + -- dependencies = { + -- "hrsh7th/cmp-nvim-lsp", + -- "hrsh7th/cmp-buffer", + -- "hrsh7th/cmp-path", + -- "saadparwaiz1/cmp_luasnip", + -- "L3MON4D3/LuaSnip", + -- }, + -- config = function() + -- local cmp = require("cmp") + -- local luasnip = require("luasnip") + -- cmp.setup({ + -- snippet = { expand = function(args) luasnip.lsp_expand(args.body) end }, + -- mapping = cmp.mapping.preset.insert({ + -- ["<C-n>"] = cmp.mapping.select_next_item(), + -- ["<C-p>"] = cmp.mapping.select_prev_item(), + -- ["<C-y>"] = cmp.mapping.confirm({ select = true }), + -- ["<C-Space>"] = cmp.mapping.complete(), + -- }), + -- sources = cmp.config.sources({ + -- { name = "nvim_lsp" }, + -- { name = "buffer" }, + -- { name = "path" }, + -- { name = "luasnip" }, + -- }), + -- }) + -- end, + -- }, +} diff --git a/comment.lua b/comment.lua new file mode 100644 index 0000000..a2331a4 --- /dev/null +++ b/comment.lua @@ -0,0 +1,14 @@ +return { + { + "numToStr/Comment.nvim", + keys = { "gc", "gb" }, -- lazy-load when using these mappings + config = function() + require("Comment").setup({ + -- your configuration here + padding = true, -- space between comment and line + sticky = true, -- keeps comment on empty lines + ignore = nil, -- lines to ignore + }) + end, + }, +} diff --git a/conform.lua b/conform.lua new file mode 100644 index 0000000..82e76b8 --- /dev/null +++ b/conform.lua @@ -0,0 +1,23 @@ +return { + "stevearc/conform.nvim", + -- event = { "BufReadPre", "BufNewFile" }, -- Load when you open a file + config = function() + local conform = require("conform") + + conform.setup({ + formatters_by_ft = { + -- Assign formatters to specific filetypes + python = { "isort", "black" }, + tex = { "tex-fmt" }, + lua = { "stylua" }, + sh = { "shfmt" }, + }, + -- This is the "Magic" part: Format on Save + format_on_save = { + lsp_fallback = true, -- Use LSP if no dedicated formatter is found + async = false, -- Formatting must be synchronous to save correctly + timeout_ms = 1000, -- Don't hang the UI for more than 0.5s + }, + }) + end, +} diff --git a/firenvim.lua b/firenvim.lua new file mode 100644 index 0000000..90d2d1d --- /dev/null +++ b/firenvim.lua @@ -0,0 +1,3 @@ +return { + { "glacambre/firenvim", build = ":call firenvim#install(0)" }, +} diff --git a/lspconfig.lua b/lspconfig.lua new file mode 100644 index 0000000..1184af8 --- /dev/null +++ b/lspconfig.lua @@ -0,0 +1,28 @@ +return { + "neovim/nvim-lspconfig", + dependencies = { "williamboman/mason.nvim" }, + config = function() + -- Define the configuration for pyright using the native API + vim.lsp.config("pyright", { + cmd = { "pyright-langserver", "--stdio" }, + filetypes = { "python" }, + root_markers = { "pyproject.toml", "setup.py", "requirements.txt", ".git" }, + settings = { + python = { + analysis = { + autoSearchPaths = true, + typeCheckingMode = "basic", + }, + }, + }, + }) + + -- Trigger the server start for python files + vim.api.nvim_create_autocmd("FileType", { + pattern = "python", + callback = function(args) + vim.lsp.start("pyright") + end, + }) + end, +} diff --git a/luasnip.lua b/luasnip.lua new file mode 100644 index 0000000..b4ff5fa --- /dev/null +++ b/luasnip.lua @@ -0,0 +1,10 @@ +return { + { + "L3MON4D3/LuaSnip", + -- follow latest release. + version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release) + -- install jsregexp (optional!). + build = "make install_jsregexp", + dependencies = { "fiadra/chadsnips" }, + }, +} diff --git a/mason.lua b/mason.lua new file mode 100644 index 0000000..2f8e561 --- /dev/null +++ b/mason.lua @@ -0,0 +1,22 @@ +return { + "williamboman/mason.nvim", + dependencies = { + "williamboman/mason-lspconfig.nvim", + }, + config = function() + require("mason").setup({ + ensure_installed = { + "black", + "isort", + "stylua", + "tex-fmt", + "shfmt", + }, + }) + require("mason-lspconfig").setup({ + ensure_installed = { + "pyright", + }, + }) + end, +} @@ -0,0 +1,17 @@ +return { + { + "jalvesaq/Nvim-R", + ft = { "r", "rmd", "R" }, + config = function() + vim.g.R_app = "radian" -- use radian for a better REPL + vim.g.R_cmd = "R" -- R command + vim.g.R_hl_term = 0 -- no syntax highlight in terminal + vim.g.R_bracketed_paste = 1 -- safer pasting + vim.g.R_assign = 2 -- `<-` on tab completion + + -- Optional: auto-send R Markdown to R + -- Use \rf in normal mode to render current file + vim.api.nvim_set_keymap("n", "<F5>", "\\rf", { noremap = true, silent = true }) + end, + }, +} diff --git a/sqlua.lua b/sqlua.lua new file mode 100644 index 0000000..ff26ec2 --- /dev/null +++ b/sqlua.lua @@ -0,0 +1,10 @@ +return { + { + "xemptuous/sqlua.nvim", + lazy = true, + cmd = "SQLua", + config = function() + require("sqlua").setup() + end, + }, +} diff --git a/surround.lua b/surround.lua new file mode 100644 index 0000000..0b5abe6 --- /dev/null +++ b/surround.lua @@ -0,0 +1,12 @@ +return { + { + "kylechui/nvim-surround", + version = "^3.0.0", -- Use for stability; omit to use `main` branch for the latest features + event = "VeryLazy", + config = function() + require("nvim-surround").setup({ + -- Configuration here, or leave empty to use defaults + }) + end, + }, +} diff --git a/telescope.lua b/telescope.lua new file mode 100644 index 0000000..f652ff2 --- /dev/null +++ b/telescope.lua @@ -0,0 +1,37 @@ +return { + { "nvim-tree/nvim-web-devicons", opts = {} }, + + { + "nvim-treesitter/nvim-treesitter", + lazy = false, + build = ":TSUpdate", + }, + + { + "nvim-telescope/telescope.nvim", + branch = "0.1.x", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local telescope = require("telescope") + telescope.setup({ + defaults = { + file_ignore_patterns = { "node_modules", ".git/" }, + }, + }) + + -- Optional keymaps + local map = vim.keymap.set + local opts = { noremap = true, silent = true } + + map("n", "<leader>fb", "<cmd>Telescope buffers<cr>", opts) + map("n", "<leader>fc", "<cmd>Telescope commands<cr>", opts) + map("n", "<leader>ff", "<cmd>Telescope find_files<cr>", opts) + map("n", "<leader>fg", "<cmd>Telescope live_grep<cr>", opts) + map("n", "<leader>fh", "<cmd>Telescope help_tags<cr>", opts) + map("n", "<leader>fm", "<cmd>Telescope marks<cr>", opts) + map("n", "<leader>fr", "<cmd>Telescope registers<cr>", opts) + map("n", "<leader>fo", "<cmd>Telescope oldfiles<cr>", opts) + map("n", "<leader>fv", "<cmd>Telescope vim_options<cr>", opts) + end, + }, +} @@ -0,0 +1,22 @@ +return { + { + "lervag/vimtex", + ft = { "tex", "bib", "latex" }, -- lazy-load on LaTeX files + config = function() + -- General vimtex settings + vim.g.vimtex_view_method = "zathura" -- PDF viewer + vim.g.vimtex_compiler_method = "latexmk" -- compiler + vim.g.vimtex_quickfix_mode = 0 -- disable quickfix + vim.g.vimtex_compiler_latexmk = { + options = { + "-pdf", + "-interaction=nonstopmode", + "-synctex=1", + }, + } + + -- Optional: F5 for compiling + vim.api.nvim_set_keymap("n", "<F5>", ":VimtexCompile<CR>", { noremap = true, silent = true }) + end, + }, +} diff --git a/undotree.lua b/undotree.lua new file mode 100644 index 0000000..3ba31fc --- /dev/null +++ b/undotree.lua @@ -0,0 +1,7 @@ +return { + -- undotree: visualize undo history + { + "mbbill/undotree", + cmd = "UndotreeToggle", -- lazy-load only when opening + }, +} diff --git a/which-key.lua b/which-key.lua new file mode 100644 index 0000000..cc9e55a --- /dev/null +++ b/which-key.lua @@ -0,0 +1,18 @@ +return { + -- Web icons + { + "nvim-tree/nvim-web-devicons", + }, + + -- which-key.nvim: shows available keybindings + { + "folke/which-key.nvim", + event = "VeryLazy", + config = function() + require("which-key").setup({ + plugins = { spelling = true }, + win = { border = "rounded" }, + }) + end, + }, +} |
