From 1fd3c1d35412d6f3b9167b258b494fc504786359 Mon Sep 17 00:00:00 2001 From: franchioping Date: Sat, 12 Apr 2025 16:42:14 +0100 Subject: [PATCH] changes --- init.lua | 29 +++++++++++++++++++++++------ lua/custom/plugins/latex-tools.lua | 6 +++--- lua/custom/plugins/leetcode.lua | 16 ++++++++++++++++ lua/kickstart/plugins/lint.lua | 8 ++++---- 4 files changed, 46 insertions(+), 13 deletions(-) create mode 100644 lua/custom/plugins/leetcode.lua diff --git a/init.lua b/init.lua index fce3261..8be5c4f 100644 --- a/init.lua +++ b/init.lua @@ -158,8 +158,9 @@ vim.opt.cursorline = true -- Minimal number of screen lines to keep above and below the cursor. vim.opt.scrolloff = 10 -vim.opt.shiftwidth = 4 -vim.opt.tabstop = 4 +vim.cmd 'set expandtab' + +vim.opt.smartindent = false -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -233,7 +234,7 @@ vim.opt.rtp:prepend(lazypath) -- NOTE: Here is where you install your plugins. require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). - -- 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically + 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following @@ -607,6 +608,13 @@ require('lazy').setup({ local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities()) + local read_exec_path = function(exec_name) + local handle = io.popen('which ' .. exec_name) + local result = handle:read('*a'):gsub('\n', '') + handle:close() + return result + end + -- Enable the following language servers -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. -- @@ -617,9 +625,17 @@ require('lazy').setup({ -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { - -- clangd = {}, + clangd = {}, -- gopls = {}, - pyright = {}, + pyright = { + + settings = { + python = { + -- Use the locally available python executable. Enables using pyright from an activated venv. + pythonPath = read_exec_path 'python', + }, + }, + }, rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- @@ -701,7 +717,7 @@ require('lazy').setup({ -- Disable "format_on_save lsp_fallback" for languages that don't -- have a well standardized coding style. You can add additional -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } + local disable_filetypes = { c = true, cpp = true, tex = true } local lsp_format_opt if disable_filetypes[vim.bo[bufnr].filetype] then lsp_format_opt = 'never' @@ -715,6 +731,7 @@ require('lazy').setup({ end, formatters_by_ft = { lua = { 'stylua' }, + markdown = { 'markdownlint' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- diff --git a/lua/custom/plugins/latex-tools.lua b/lua/custom/plugins/latex-tools.lua index d2a8bba..94afc69 100644 --- a/lua/custom/plugins/latex-tools.lua +++ b/lua/custom/plugins/latex-tools.lua @@ -8,9 +8,9 @@ return { -- VimTeX configuration goes here, e.g. vim.g.vimtex_view_method = 'zathura' end, - -- config = function() - -- vim.g.vimtex_indent_enabled = 0 - -- end, + config = function() + vim.g.vimtex_compiler_latexmk = { ['out_dir'] = '/home/franchioping/Notes/build' } + end, }, { 'franchioping/luasnip-latex-snippets.nvim', diff --git a/lua/custom/plugins/leetcode.lua b/lua/custom/plugins/leetcode.lua new file mode 100644 index 0000000..88a29f7 --- /dev/null +++ b/lua/custom/plugins/leetcode.lua @@ -0,0 +1,16 @@ +return { + { + 'kawre/leetcode.nvim', + build = ':TSUpdate html', -- if you have `nvim-treesitter` installed + dependencies = { + 'nvim-telescope/telescope.nvim', + -- "ibhagwan/fzf-lua", + 'nvim-lua/plenary.nvim', + 'MunifTanjim/nui.nvim', + 'nvim-treesitter/nvim-treesitter', + }, + opts = { + -- configuration goes here + }, + }, +} diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index e81cc33..66cd2e2 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -5,9 +5,9 @@ return { event = { 'BufReadPre', 'BufNewFile' }, config = function() local lint = require 'lint' - -- lint.linters_by_ft = { - -- markdown = { 'markdownlint' }, - -- } + lint.linters_by_ft = { + markdown = { 'markdownlint' }, + } -- To allow other plugins to add linters to require('lint').linters_by_ft, -- instead set linters_by_ft like this: @@ -39,7 +39,7 @@ return { -- lint.linters_by_ft['rst'] = nil -- lint.linters_by_ft['ruby'] = nil -- lint.linters_by_ft['terraform'] = nil - -- lint.linters_by_ft['text'] = nil + lint.linters_by_ft['text'] = nil -- Create autocommand which carries out the actual linting -- on the specified events.