-- vim.g.delimitMate_expand_space=1 -- vim.g.delimitMate_expand_cr = 1 require('mini.pairs').setup() require('mini.align').setup() require('mini.bracketed').setup() require('mini.splitjoin').setup() require('mini.move').setup() require('mini.move').setup() require('flash').setup() require('ts-comments').setup() vim.g.tagbar_left=1 vim.g.tagbar_autoclose=1 vim.g.tagbar_autofocus=1 vim.g.windowswap_map_keys=0 local cmp = require('cmp') local lspkind = require('lspkind') cmp.setup({ snippet = { expand = function(args) vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. end, }, window = { completion = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(), }, mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), [''] = cmp.mapping.complete(), [''] = cmp.mapping.abort(), [''] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. }), sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'vsnip' }, { name = 'path' }, { name = 'cmp_yanky' }, { name = 'git' }, { name = 'copilot' }, -- }, { { name = 'buffer', keyword_length = 2 }, }), formatting = { format = lspkind.cmp_format({ -- mode = "symbol_text", mode = "symbol", menu = ({ buffer = "[buf]", nvim_lsp = "[lsp]", vsnip = "[snip]", nvim_lua = "[lua]", latex_symbols = "[tex]", path = "[path]", cmp_yanky = "[yank]", copilot = "[copilot]", }), symbol_map = { Copilot = "" } }), }, }) -- -- 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' }, -- }) -- }) cmp.setup.cmdline({ '/', '?' }, { mapping = cmp.mapping.preset.cmdline(), sources = { { name = 'buffer' } } }) cmp.setup.cmdline(':', { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ { name = 'path' } }, { { name = 'cmdline' } }), matching = { disallow_symbol_nonprefix_matching = false } }) local capabilities = require('cmp_nvim_lsp').default_capabilities() local lspconfig = require("lspconfig") -- lspconfig.svelte.setup({ capabilities = capabilities }) -- lspconfig.flow.setup({ capabilities = capabilities }) -- lspconfig.nil_ls.setup({ capabilities = capabilities }) capabilities.textDocument.foldingRange = { dynamicRegistration = false, lineFoldingOnly = true } local language_servers = vim.lsp.get_clients() -- or list servers manually like {'gopls', 'clangd'} for _, ls in ipairs(language_servers) do require('lspconfig')[ls].setup({ capabilities = capabilities -- you can add other fields for setting up lsp server in this table }) end require('ufo').setup() require("yanky").setup({ ring = { history_length = 100, storage = "shada", sync_with_numbered_registers = true, cancel_event = "update", }, system_clipboard = { sync_with_ring = true, }, preserve_cursor_position = { enabled = true, }, }) require("telescope").load_extension("yank_history") require'nvim-treesitter.configs'.setup { -- ensure_installed = { "lua", "vim", "help" }, ensure_installed = {}, sync_install = false, auto_install = false, highlight = { enable = true, disable = function(lang, buf) local max_filesize = 100 * 1024 -- 100 KB local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) if ok and stats and stats.size > max_filesize then return true end end, additional_vim_regex_highlighting = false, }, } require('lualine').setup({ options = { icons_enabled = true, theme = 'Tomorrow', component_separators = { left = '', right = ''}, section_separators = { left = '', right = ''}, disabled_filetypes = { statusline = {}, winbar = {}, }, ignore_focus = {}, always_divide_middle = true, globalstatus = true, refresh = { statusline = 1000, tabline = 1000, winbar = 1000, } }, sections = { lualine_a = {'mode'}, lualine_b = {'branch', 'diff', 'diagnostics'}, lualine_c = {'filename'}, lualine_x = {'encoding', 'fileformat', 'filetype'}, lualine_y = {'progress'}, lualine_z = {'location'} }, inactive_sections = { lualine_a = {}, lualine_b = {}, lualine_c = {'filename'}, lualine_x = {'location'}, lualine_y = {}, lualine_z = {} }, tabline = {}, winbar = {}, inactive_winbar = {}, extensions = {} }) require("copilot").setup({ suggestion = { enabled = false }, panel = { enabled = false }, }) require("copilot_cmp").setup() vim.g.bullets_enabled_file_types = { 'markdown', 'text', 'gitcommit', 'scratch' } require("nvim-tree").setup({ sort = { sorter = "case_sensitive", }, view = { width = 30, }, renderer = { group_empty = true, }, -- filters = { -- dotfiles = true, -- }, }) require('gitsigns').setup { signs = { add = { text = '┃' }, change = { text = '┃' }, delete = { text = '_' }, topdelete = { text = '‾' }, changedelete = { text = '~' }, untracked = { text = '┆' }, }, signs_staged = { add = { text = '┃' }, change = { text = '┃' }, delete = { text = '_' }, topdelete = { text = '‾' }, changedelete = { text = '~' }, untracked = { text = '┆' }, }, signs_staged_enable = true, signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` numhl = false, -- Toggle with `:Gitsigns toggle_numhl` linehl = false, -- Toggle with `:Gitsigns toggle_linehl` word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` watch_gitdir = { follow_files = true }, auto_attach = true, attach_to_untracked = false, current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` current_line_blame_opts = { virt_text = true, virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' delay = 1000, ignore_whitespace = false, virt_text_priority = 100, use_focus = true, }, current_line_blame_formatter = ', - ', sign_priority = 6, update_debounce = 100, status_formatter = nil, -- Use default max_file_length = 40000, -- Disable if file is longer than this (in lines) preview_config = { -- Options passed to nvim_open_win style = 'minimal', relative = 'cursor', row = 0, col = 1 }, } require("conform").setup({ python = {"black"}, rust = {"rustfmt"}, go = {"gofmt"}, }) require("trouble").setup() require("todo-comments").setup() require("dapui").setup() require("nvim-dap-virtual-text").setup() local dap, dapui = require("dap"), require("dapui") dap.listeners.before.attach.dapui_config = function() dapui.open() end dap.listeners.before.launch.dapui_config = function() dapui.open() end dap.listeners.before.event_terminated.dapui_config = function() dapui.close() end dap.listeners.before.event_exited.dapui_config = function() dapui.close() end if vim.fn.has("mac") then workspaces = { { name = "privat", path = "~/Documents/notes/privat", }, { name = "joplin", path = "~/Documents/notes/fromjoplin", }, } daily_notes = { folder = "Journal", date_format = "%Y-%m-%d", default_tags = { "journal" }, template = "daily.md" } elseif vim.fn.has("win32") then workspaces = { { name = "work", path = "/mnt/c/Users/marti/Documents/notes/Work", }, { name = "privat", path = "/mnt/c/Users/marti/Documents/notes/privat", }, } daily_notes = {} end require("obsidian").setup({ workspaces = workspaces, templates = { folder = "_templates", date_format = "%Y-%m-%d %a", time_format = "%H:%M", }, ui = { checkboxes = { [" "] = { char = "󰄱", hl_group = "ObsidianTodo" }, [">"] = { char = "", hl_group = "ObsidianRightArrow" }, ["x"] = { char = "", hl_group = "ObsidianDone" }, ["~"] = { char = "󰰱", hl_group = "ObsidianTilde" }, ["!"] = { char = "", hl_group = "ObsidianImportant" }, ["?"] = { char = "?", hl_group = "ObsidianImportant" } }, }, disable_frontmatter = false, note_frontmatter_func = function(note) -- Add the title of the note as an alias. if note.title then note:add_alias(note.title) end local out = { id = note.id, tags = note.tags } if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then for k, v in pairs(note.metadata) do out[k] = v end end return out end, note_path_func = function(spec) local path = spec.dir / spec.title return path:with_suffix(".md") end, daily_notes = daily_notes, })