diff --git a/README.md b/README.md index 7c62e907134..7eaf756657a 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,9 @@ # kickstart.nvim -## Introduction +Personal fork of kickstart.nvim -A starting point for Neovim that is: +[Link to kickstart repo](https://github.com/nvim-lua/kickstart.nvim) -* Small -* Single-file -* Completely Documented - -**NOT** a Neovim distribution, but instead a starting point for your configuration. ## Installation @@ -28,7 +23,6 @@ alternative [installation methods below](#alternative-neovim-installation-method ### Install External Dependencies -External Requirements: - Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`) - [ripgrep](https://github.com/BurntSushi/ripgrep#installation), [fd-find](https://github.com/sharkdp/fd#installation) @@ -37,94 +31,10 @@ External Requirements: - A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons - if you have it set `vim.g.have_nerd_font` in `init.lua` to true - Emoji fonts (Ubuntu only, and only if you want emoji!) `sudo apt install fonts-noto-color-emoji` -- Language Setup: - - If you want to write Typescript, you need `npm` - - If you want to write Golang, you will need `go` - - etc. - -> [!NOTE] -> See [Install Recipes](#Install-Recipes) for additional Windows and Linux specific notes -> and quick install snippets ### Install Kickstart -> [!NOTE] -> [Backup](#FAQ) your previous configuration (if any exists) - -Neovim's configurations are located under the following paths, depending on your OS: - -| OS | PATH | -| :- | :--- | -| Linux, MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` | -| Windows (cmd)| `%localappdata%\nvim\` | -| Windows (powershell)| `$env:LOCALAPPDATA\nvim\` | - -#### Recommended Step - -[Fork](https://docs.github.com/en/get-started/quickstart/fork-a-repo) this repo -so that you have your own copy that you can modify, then install by cloning the -fork to your machine using one of the commands below, depending on your OS. - -> [!NOTE] -> Your fork's URL will be something like this: -> `https://github.com//kickstart.nvim.git` - -You likely want to remove `nvim-pack-lock.json` from your fork's `.gitignore` -file too - it's ignored in the kickstart repo to make maintenance easier, but -it's recommended to track it in version control (see `:help vim.pack-lockfile`). - -#### Clone kickstart.nvim - -> [!NOTE] -> If following the recommended step above (i.e., forking the repo), replace -> `nvim-lua` with `` in the commands below - -
Linux and Mac - -```sh -git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim -``` - -
- -
Windows - -If you're using `cmd.exe`: - -``` -git clone https://github.com/nvim-lua/kickstart.nvim.git "%localappdata%\nvim" -``` - -If you're using `powershell.exe` - -``` -git clone https://github.com/nvim-lua/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim" -``` - -
- -### Post Installation - -Start Neovim - -```sh -nvim -``` - -That's it! `vim.pack` will install all the plugins from your config. Use -`:lua vim.pack.update(nil, { offline = true })` to inspect plugin state and -`:lua vim.pack.update()` to fetch updates (`:write` applies updates, `:quit` -cancels them). - -#### Read The Friendly Documentation - -Read through the `init.lua` file in your configuration folder for more -information about extending and exploring Neovim. That also includes -examples of adding popularly requested plugins. - -> [!NOTE] -> For more information about a particular plugin check its repository's documentation. - +After cloning, move files into ~/.config/nvim/ ### Getting Started @@ -269,77 +179,4 @@ sudo pacman -S --noconfirm --needed gcc make git ripgrep fd tree-sitter-cli unzi ``` -### Alternative neovim installation methods - -For some systems it is not unexpected that the [package manager installation -method](https://github.com/neovim/neovim/blob/master/INSTALL.md#install-from-package) -recommended by neovim is significantly behind. If that is the case for you, -pick one of the following methods that are known to deliver fresh neovim versions very quickly. -They have been picked for their popularity and because they make installing and updating -neovim to the latest versions easy. You can also find more detail about the -available methods being discussed -[here](https://github.com/nvim-lua/kickstart.nvim/issues/1583). - - -
Bob - -[Bob](https://github.com/MordechaiHadad/bob) is a Neovim version manager for -all platforms. Simply install -[rustup](https://rust-lang.github.io/rustup/installation/other.html), -and run the following commands: - -```bash -rustup default stable -rustup update stable -cargo install bob-nvim -bob use stable -``` - -
- -
Homebrew - -[Homebrew](https://brew.sh) is a package manager popular on Mac and Linux. -Simply install using [`brew install`](https://formulae.brew.sh/formula/neovim). - -
- -
Flatpak - -Flatpak is a package manager for applications that allows developers to package their applications -just once to make it available on all Linux systems. Simply [install flatpak](https://flatpak.org/setup/) -and setup [flathub](https://flathub.org/setup) to [install neovim](https://flathub.org/apps/io.neovim.nvim). - -
- -
asdf and mise-en-place - -[asdf](https://asdf-vm.com/) and [mise](https://mise.jdx.dev/) are tool version managers, -mostly aimed towards project-specific tool versioning. However both support managing tools -globally in the user-space as well: - -
mise - -[Install mise](https://mise.jdx.dev/getting-started.html), then run: - -```bash -mise plugins install neovim -mise use neovim@stable -``` - -
- -
asdf - -[Install asdf](https://asdf-vm.com/guide/getting-started.html), then run: - -```bash -asdf plugin add neovim -asdf install neovim stable -asdf set neovim stable --home -asdf reshim neovim -``` - -
- -
+test diff --git a/init.lua b/init.lua index 5d29c72dc94..b0e15c30080 100644 --- a/init.lua +++ b/init.lua @@ -1,287 +1,178 @@ ---[[ +---[[ -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== -======== .-----. ======== -======== .----------------------. | === | ======== -======== |.-""""""""""""""""""-.| |-----| ======== -======== || || | === | ======== -======== || KICKSTART.NVIM || |-----| ======== -======== || || | === | ======== -======== || || |-----| ======== -======== ||:Tutor || |:::::| ======== -======== |'-..................-'| |____o| ======== -======== `"")----------------(""` ___________ ======== -======== /::::::::::| |::::::::::\ \ no mouse \ ======== -======== /:::========| |==hjkl==:::\ \ required \ ======== -======== '""""""""""""' '""""""""""""' '""""""""""' ======== -======== ======== -===================================================================== -===================================================================== +-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' -What is Kickstart? +vim.g.have_nerd_font = true - Kickstart.nvim is *not* a distribution. +-- [[ Setting options ]] +-- See `:help vim.o` +-- NOTE: You can change these options as you wish! +-- For more options, you can see `:help option-list` - Kickstart.nvim is a starting point for your own configuration. - The goal is that you can read every line of code, top-to-bottom, understand - what your configuration is doing, and modify it to suit your needs. +-- Make line numbers default +vim.o.number = true +vim.o.relativenumber = true - Once you've done that, you can start exploring, configuring and tinkering to - make Neovim your own! That might mean leaving Kickstart just the way it is for a while - or immediately breaking it into modular pieces. It's up to you! +-- Enable mouse mode, can be useful for resizing splits for example! +vim.o.mouse = 'a' +-- Don't show the mode, since it's already in the status line +vim.o.showmode = false - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example which will only take 10-15 minutes: - - https://learnxinyminutes.com/docs/lua/ +vim.schedule(function() + vim.o.clipboard = 'unnamedplus' +end) - After understanding a bit more about Lua, you can use `:help lua-guide` as a - reference for how Neovim integrates Lua. - - :help lua-guide - - (or HTML version): https://neovim.io/doc/user/lua-guide.html +-- Enable break indent +vim.o.breakindent = true +-- Save undo history +vim.o.undofile = true -Kickstart Guide: +-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term +vim.o.ignorecase = true +vim.o.smartcase = true +vim.o.smartindent = true - TODO: The very first thing you should do is to run the command `:Tutor` in Neovim. +-- Keep signcolumn on by default +vim.o.signcolumn = 'yes' - If you don't know what this means, type the following: - - - - : - - Tutor - - +-- Decrease update time +vim.o.updatetime = 150 - (If you already know the Neovim basics, you can skip this step.) +-- Decrease mapped sequence wait time +vim.o.timeoutlen = 300 - Once you've completed that, you can continue working through **AND READING** the rest - of the kickstart init.lua. +-- Configure how new splits should be opened +vim.o.splitright = true +vim.o.splitbelow = false - Next, run AND READ `:help`. - This will open up a help window with some basic information - about reading, navigating and searching the builtin help documentation. +vim.o.list = true +vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } - This should be the first place you go to look when you're stuck or confused - with something. It's one of my favorite Neovim features. +-- Preview substitutions live, as you type! +vim.o.inccommand = 'split' - MOST IMPORTANTLY, we provide a keymap "sh" to [s]earch the [h]elp documentation, - which is very useful when you're not exactly sure of what you're looking for. +-- Show which line your cursor is on +vim.o.cursorline = true - I have left several `:help X` comments throughout the init.lua - These are hints about where to find more information about the relevant settings, - plugins or Neovim features used in Kickstart. +-- Minimal number of screen lines to keep above and below the cursor. +vim.o.scrolloff = 15 - NOTE: Look for lines like this +vim.o.confirm = true +vim.o.wrap = false +-- [[ Basic Keymaps ]] +-- See `:help vim.keymap.set()` - Throughout the file. These are for you, the reader, to help you understand what is happening. - Feel free to delete them once you know what you're doing, but they should serve as a guide - for when you are first encountering a few different constructs in your Neovim config. +vim.keymap.set('n', '', 'nohlsearch') -If you experience any errors while trying to install kickstart, run `:checkhealth` for more info. +-- Diagnostic keymaps +vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) -I hope you enjoy your Neovim journey, -- TJ +local lsp_show = true +vim.keymap.set('n', 'ul', function() + lsp_show = not lsp_show -P.S. You can delete this when you're done too. It's your config now! :) ---]] - --- ============================================================ --- SECTION 1: FOUNDATION --- Core Neovim settings, leaders, options, basic keymaps, basic autocmds --- ============================================================ -do - -- Enable faster startup by caching compiled Lua modules - vim.loader.enable() - - -- Set as the leader key - -- See `:help mapleader` - -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) - vim.g.mapleader = ' ' - vim.g.maplocalleader = ' ' - - -- Set to true if you have a Nerd Font installed and selected in the terminal - vim.g.have_nerd_font = false - - -- [[ Setting options ]] - -- See `:help vim.o` - -- NOTE: You can change these options as you wish! - -- For more options, you can see `:help option-list` - - -- Make line numbers default - vim.o.number = true - -- You can also add relative line numbers, to help with jumping. - -- Experiment for yourself to see if you like it! - -- vim.o.relativenumber = true - - -- Enable mouse mode, can be useful for resizing splits for example! - vim.o.mouse = 'a' - - -- Don't show the mode, since it's already in the status line - vim.o.showmode = false - - -- Sync clipboard between OS and Neovim. - -- Schedule the setting after `UiEnter` because it can increase startup-time. - -- Remove this option if you want your OS clipboard to remain independent. - -- See `:help 'clipboard'` - vim.schedule(function() vim.o.clipboard = 'unnamedplus' end) - - -- Enable break indent - vim.o.breakindent = true - - -- Enable undo/redo changes even after closing and reopening a file - vim.o.undofile = true - - -- Case-insensitive searching UNLESS \C or one or more capital letters in the search term - vim.o.ignorecase = true - vim.o.smartcase = true - - -- Keep signcolumn on by default - vim.o.signcolumn = 'yes' - - -- Decrease update time - vim.o.updatetime = 250 - - -- Decrease mapped sequence wait time - vim.o.timeoutlen = 300 - - -- Configure how new splits should be opened - vim.o.splitright = true - vim.o.splitbelow = true - - -- Sets how neovim will display certain whitespace characters in the editor. - -- See `:help 'list'` - -- and `:help 'listchars'` - -- - -- Notice listchars is set using `vim.opt` instead of `vim.o`. - -- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables. - -- See `:help lua-options` - -- and `:help lua-guide-options` - vim.o.list = true - vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } - - -- Preview substitutions live, as you type! - vim.o.inccommand = 'split' - - -- Show which line your cursor is on - vim.o.cursorline = true - - -- Minimal number of screen lines to keep above and below the cursor. - vim.o.scrolloff = 10 - - -- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`), - -- instead raise a dialog asking if you wish to save the current file(s) - -- See `:help 'confirm'` - vim.o.confirm = true - - -- [[ Basic Keymaps ]] - -- See `:help vim.keymap.set()` - - -- Clear highlights on search when pressing in normal mode - -- See `:help hlsearch` - vim.keymap.set('n', '', 'nohlsearch') - - -- Diagnostic Config & Keymaps - -- See `:help vim.diagnostic.Opts` - vim.diagnostic.config { - update_in_insert = false, - severity_sort = true, - float = { border = 'rounded', source = 'if_many' }, - underline = { severity = { min = vim.diagnostic.severity.WARN } }, - - -- Can switch between these as you prefer - virtual_text = true, -- Text shows up at the end of the line - virtual_lines = false, -- Text shows up underneath the line, with virtual lines - - -- Auto open the float, so you can easily read the errors when jumping with `[d` and `]d` - jump = { - on_jump = function(_, bufnr) - vim.diagnostic.open_float { - bufnr = bufnr, - scope = 'cursor', - focus = false, - } - end, - }, - } - - vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) - - -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier - -- for people to discover. Otherwise, you normally need to press , which - -- is not what someone will guess without a bit more experience. - -- - -- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping - -- or just use to exit terminal mode - vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) - - -- TIP: Disable arrow keys in normal mode - -- vim.keymap.set('n', '', 'echo "Use h to move!!"') - -- vim.keymap.set('n', '', 'echo "Use l to move!!"') - -- vim.keymap.set('n', '', 'echo "Use k to move!!"') - -- vim.keymap.set('n', '', 'echo "Use j to move!!"') - - -- Keybinds to make split navigation easier. - -- Use CTRL+ to switch between windows - -- - -- See `:help wincmd` for a list of all window commands - vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) - vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) - vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) - vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) - - -- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes - -- vim.keymap.set("n", "", "H", { desc = "Move window to the left" }) - -- vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) - -- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) - -- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) - - -- [[ Basic Autocommands ]] - -- See `:help lua-guide-autocommands` - - -- Highlight when yanking (copying) text - -- Try it with `yap` in normal mode - -- See `:help vim.hl.on_yank()` - vim.api.nvim_create_autocmd('TextYankPost', { - desc = 'Highlight when yanking (copying) text', - group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), - callback = function() vim.hl.on_yank() end, - }) -end + if lsp_show then + vim.lsp.handlers['window/showMessage'] = vim.lsp.handlers['window/showMessageDefault'] + print 'LSP messages ON' + else + vim.lsp.handlers['window/showMessage'] = function() end + print 'LSP messages OFF' + end +end, { desc = 'Toggle LSP messages' }) +-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier +-- for people to discover. Otherwise, you normally need to press , which +-- is not what someone will guess without a bit more experience. +-- +-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping +-- or just use to exit terminal mode +vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) + +-- Disable plugins +local notify_enabled = true + +vim.keymap.set('n', 'un', function() + notify_enabled = not notify_enabled + + if notify_enabled then + vim.notify = require 'notify' + else + vim.notify = function() end + end +end, { desc = 'Toggle notifications' }) + +-- TIP: Disable arrow keys in normal mode +vim.keymap.set('n', '', 'echo "Use h to move!!"') +vim.keymap.set('n', '', 'echo "Use l to move!!"') +vim.keymap.set('n', '', 'echo "Use k to move!!"') +vim.keymap.set('n', '', 'echo "Use j to move!!"') + +-- Keybinds to make split navigation easier. +-- Use CTRL+ to switch between windows +-- +-- See `:help wincmd` for a list of all window commands +vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) +vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) + +-- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes +-- vim.keymap.set("n", "", "H", { desc = "Move window to the left" }) +-- vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) +-- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) +-- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) + +vim.keymap.set('n', 'tw', function() + vim.wo.wrap = not vim.wo.wrap + print('Wrap ' .. (vim.wo.wrap and 'enabled' or 'disabled')) +end, { desc = 'Toggle line wrap' }) + +vim.keymap.set('n', 'tr', function() + -- Ensure line wrapping is enabled + if vim.bo.filetype ~= 'markdown' then + return + end --- ============================================================ --- SECTION 2: PLUGIN MANAGER INTRO --- vim.pack intro, build hooks --- ============================================================ -do - -- [[ Intro to `vim.pack` ]] - -- `vim.pack` is a new plugin manager built into Neovim, - -- which provides a Lua interface for installing and managing plugins. - -- - -- See `:help vim.pack`, `:help vim.pack-examples` or the - -- excellent blog post from the creator of vim.pack and mini.nvim: - -- https://echasnovski.com/blog/2026-03-13-a-guide-to-vim-pack - -- - -- To inspect plugin state and pending updates, run - -- :lua vim.pack.update(nil, { offline = true }) - -- - -- To update plugins, run - -- :lua vim.pack.update() - -- - -- - -- Throughout the rest of the config there will be examples - -- of how to install and configure plugins using `vim.pack`. - -- - -- In this section we set up some autocommands to run build - -- steps for certain plugins after they are installed or updated. - - local function run_build(name, cmd, cwd) - local result = vim.system(cmd, { cwd = cwd }):wait() - if result.code ~= 0 then - local stderr = result.stderr or '' - local stdout = result.stdout or '' - local output = stderr ~= '' and stderr or stdout - if output == '' then output = 'No output from build command.' end - vim.notify(('Build failed for %s:\n%s'):format(name, output), vim.log.levels.ERROR) - end + vim.opt_local.wrap = true + vim.opt_local.linebreak = true + + -- Toggle RenderMarkdown + vim.cmd 'RenderMarkdown toggle' + + print 'RenderMarkdown enabled with line wrap' +end, { desc = 'Toggle RenderMarkdown + enable wrap' }) + +vim.keymap.set('n', 'tp', 'RenderMarkdown preview', { desc = 'Toggle Render md preview' }) +-- [[ Basic Autocommands ]] +-- See `:help lua-guide-autocommands` +-- +vim.api.nvim_create_autocmd('FileType', { + pattern = 'fsharp', + callback = function() + vim.opt_local.expandtab = true + vim.opt_local.tabstop = 4 + vim.opt_local.shiftwidth = 4 + vim.opt_local.softtabstop = 4 + end, +}) + +vim.api.nvim_create_autocmd('TextYankPost', { + desc = 'Highlight when yanking (copying) text', + group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }), + callback = function() + vim.hl.on_yank() + end, +}) + +-- [[ Install `lazy.nvim` plugin manager ]] +-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info +local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' +if not (vim.uv or vim.loop).fs_stat(lazypath) then + local lazyrepo = 'https://github.com/folke/lazy.nvim.git' + local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } + if vim.v.shell_error ~= 0 then + error('Error cloning lazy.nvim:\n' .. out) end -- This autocommand runs after a plugin is installed or updated and @@ -960,18 +851,76 @@ do -- Here are some example plugins that I've included in the Kickstart repository. -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- - -- require 'kickstart.plugins.debug' - -- require 'kickstart.plugins.indent_line' - -- require 'kickstart.plugins.lint' - -- require 'kickstart.plugins.autopairs' - -- require 'kickstart.plugins.neo-tree' - -- require 'kickstart.plugins.gitsigns' -- adds gitsigns recommended keymaps - - -- NOTE: You can add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` + -- require 'kickstart.plugins.debug', + -- require 'kickstart.plugins.indent_line', + -- require 'kickstart.plugins.lint', + -- require 'kickstart.plugins.autopairs', + -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + + -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` + -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- require 'custom.plugins' -end + { import = 'custom.plugins' }, + { import = 'custom.plugins.themes' }, + -- + -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` + -- Or use telescope! + -- In normal mode type `sh` then write `lazy.nvim-plugin` + -- you can continue same window with `sr` which resumes last telescope search +}, { + lockfile = vim.fn.stdpath 'data' .. '/lazy-lock.json', + ui = { + -- If you are using a Nerd Font: set icons to an empty table which will use the + -- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table + icons = vim.g.have_nerd_font and {} or { + cmd = '⌘', + config = '🛠', + event = '📅', + ft = '📂', + init = '⚙', + keys = '🗝', + plugin = '🔌', + runtime = '💻', + require = '🌙', + source = '📄', + start = '🚀', + task = '📌', + lazy = '💤 ', + }, + }, +}) -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et + +vim.lsp.config('fsautocomplete', { + cmd = { 'fsautocomplete', '--adaptive-lsp-server-enabled' }, + + filetypes = { 'fsharp' }, + + root_dir = function(bufnr) + return vim.fs.root(bufnr, { '*.fsproj', '.git' }) + end, + + settings = { + FsAutoComplete = { + LazyProjectWorkspace = true, + BackgroundAnalysis = false, + ExternalAutocomplete = false, + Linter = false, + UnionCaseStubGeneration = false, + RecordStubGeneration = false, + InterfaceStubGeneration = false, + }, + }, + + on_attach = function(client, bufnr) + client.server_capabilities.semanticTokensProvider = nil + client.server_capabilities.documentFormattingProvider = false + client.server_capabilities.documentRangeFormattingProvider = false + end, +}) + +vim.lsp.enable 'fsautocomplete' +require 'custom.themes' diff --git a/lua/custom/plugins/data-preview.lua b/lua/custom/plugins/data-preview.lua new file mode 100644 index 00000000000..506a6467b3f --- /dev/null +++ b/lua/custom/plugins/data-preview.lua @@ -0,0 +1,15 @@ +return { + 'vinvolve/data-preview.nvim', + cmd = { 'DataPreview', 'DataPreviewStats' }, + config = function() + local data_preview = require 'data-preview' + vim.api.nvim_create_user_command('DataPreview', data_preview.preview, { + nargs = 0, + desc = 'Preview data file (Parquet, Avro)', + }) + vim.api.nvim_create_user_command('DataPreviewStats', data_preview.preview_stats, { + nargs = 0, + desc = 'Preview data file statistics (min, max, nulls, etc.)', + }) + end, +} diff --git a/lua/custom/plugins/hardtime.lua b/lua/custom/plugins/hardtime.lua new file mode 100644 index 00000000000..ae30ca470ce --- /dev/null +++ b/lua/custom/plugins/hardtime.lua @@ -0,0 +1,11 @@ +return { + 'm4xshen/hardtime.nvim', + lazy = false, + dependencies = { 'MunifTanjim/nui.nvim' }, + opts = { + disabled = false, + max_time = 500, + max_count = 5, + notification = true, + }, +} diff --git a/lua/custom/plugins/neo-tree.lua b/lua/custom/plugins/neo-tree.lua new file mode 100644 index 00000000000..5dcda567cb1 --- /dev/null +++ b/lua/custom/plugins/neo-tree.lua @@ -0,0 +1,44 @@ +-- Neo-tree is a Neovim plugin to browse the file system +-- https://github.com/nvim-neo-tree/neo-tree.nvim + +return { + 'nvim-neo-tree/neo-tree.nvim', + version = '*', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended + 'MunifTanjim/nui.nvim', + }, + auto_close = true, + auto_open = false, + lazy = false, + keys = { + { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, + { '½', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, + }, + opts = { + filesystem = { + filtered_items = { + visible = true, + hide_dotfiles = true, + hide_gitignored = true, + }, + window = { + mappings = { + ['\\'] = 'close_window', + ['½'] = 'close_window', + ['P'] = { + 'toggle_preview', + config = { + width = '10%', + }, + }, + ['l'] = 'focus_preview', + }, + position = 'left', + width = '20', + }, + hijack_netrw_behavior = 'open_default', + }, + }, +} diff --git a/lua/custom/plugins/notify.lua b/lua/custom/plugins/notify.lua new file mode 100644 index 00000000000..3e665c8d410 --- /dev/null +++ b/lua/custom/plugins/notify.lua @@ -0,0 +1,14 @@ +return { + 'rcarriga/nvim-notify', + config = function() + require('notify').setup { + background_colour = '#000000', + stages = 'fade', + timeout = 300, + render = 'wrapped-compact', + } + + -- MUST be after setup + vim.notify = require 'notify' + end, +} diff --git a/lua/custom/plugins/render-markdown.lua b/lua/custom/plugins/render-markdown.lua new file mode 100644 index 00000000000..0eab3f9f829 --- /dev/null +++ b/lua/custom/plugins/render-markdown.lua @@ -0,0 +1,11 @@ +return { + 'MeanderingProgrammer/render-markdown.nvim', + dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.nvim' }, -- if you use the mini.nvim suite + -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-mini/mini.icons' }, -- if you use standalone mini plugins + -- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons + ---@module 'render-markdown' + ---@type render.md.UserConfig + opts = { + render_modes = {}, + }, +} diff --git a/lua/custom/plugins/themes.lua b/lua/custom/plugins/themes.lua new file mode 100644 index 00000000000..1d8d8cd3c67 --- /dev/null +++ b/lua/custom/plugins/themes.lua @@ -0,0 +1,5 @@ +return { + { 'folke/tokyonight.nvim', lazy = false, priority = 1000 }, + { 'ellisonleao/gruvbox.nvim', lazy = false, priority = 1000 }, + { 'catppuccin/nvim', name = 'catppuccin', lazy = false, priority = 1000 }, +} diff --git a/lua/custom/plugins/vimtex.lua b/lua/custom/plugins/vimtex.lua new file mode 100644 index 00000000000..b632b8c4040 --- /dev/null +++ b/lua/custom/plugins/vimtex.lua @@ -0,0 +1,12 @@ +-- See the kickstart.nvim README for more information +return { + { + 'lervag/vimtex', + lazy = false, -- we don't want to lazy load VimTeX + -- tag = "v2.15", -- uncomment to pin to a specific release + init = function() + -- VimTeX configuration goes here, e.g. + vim.g.vimtex_view_method = 'zathura' + end, + }, +} diff --git a/lua/custom/plugins/virtcolumn.lua b/lua/custom/plugins/virtcolumn.lua new file mode 100644 index 00000000000..663a5f2894a --- /dev/null +++ b/lua/custom/plugins/virtcolumn.lua @@ -0,0 +1,19 @@ +-- See the kickstart.nvim README for more information +return { + 'lukas-reineke/virt-column.nvim', + config = function() + require('virt-column').setup { + virtcolumn = '80,120', + exclude = { + filetypes = { + 'help', + 'lazy', + 'mason', + 'dashboard', + 'NvimTree', + }, + }, + char = '|', + } + end, +} diff --git a/lua/custom/themes/catppuccin.lua b/lua/custom/themes/catppuccin.lua new file mode 100644 index 00000000000..1db857245cd --- /dev/null +++ b/lua/custom/themes/catppuccin.lua @@ -0,0 +1,17 @@ +return function() + -- setup Catppuccin + require('catppuccin').setup { + flavour = 'macchiato', -- options: latte, frappe, macchiato, mocha + integrations = { + -- Optional: enable integrations for plugins like telescope, lualine, etc + telescope = true, + nvimtree = true, + cmp = true, + mason = true, + treesitter = true, + }, + transparent_background = true, + } + -- load the colorscheme + vim.cmd.colorscheme 'catppuccin' +end diff --git a/lua/custom/themes/gruvbox.lua b/lua/custom/themes/gruvbox.lua new file mode 100644 index 00000000000..bd16d166cb5 --- /dev/null +++ b/lua/custom/themes/gruvbox.lua @@ -0,0 +1,26 @@ +return function() + require('gruvbox').setup { + terminal_colors = true, -- add neovim terminal colors + undercurl = true, + underline = true, + bold = true, + italic = { + strings = true, + emphasis = true, + comments = true, + operators = false, + folds = true, + }, + strikethrough = true, + invert_selection = false, + invert_signs = false, + invert_tabline = false, + inverse = true, -- invert background for search, diffs, statuslines and errors + contrast = 'soft', -- can be "hard", "soft" or empty string + palette_overrides = {}, + overrides = {}, + dim_inactive = false, + transparent_mode = true, + } + vim.cmd 'colorscheme gruvbox' +end diff --git a/lua/custom/themes/init.lua b/lua/custom/themes/init.lua new file mode 100644 index 00000000000..be435a9ebb7 --- /dev/null +++ b/lua/custom/themes/init.lua @@ -0,0 +1,12 @@ +-- Pick which theme to use +-- tokyonight, gruvbox, catppuccin +local theme_name = 'catppuccin' -- + +-- Loading it +local ok, theme = pcall(require, 'custom.themes.' .. theme_name) +if not ok then + vim.notify('Failed to load theme: ' .. theme_name, vim.log.levels.ERROR) + return +end + +theme() diff --git a/lua/custom/themes/tokyonight.lua b/lua/custom/themes/tokyonight.lua new file mode 100644 index 00000000000..4b6147795ac --- /dev/null +++ b/lua/custom/themes/tokyonight.lua @@ -0,0 +1,8 @@ +-- ~/.config/nvim/lua/custom/themes/tokyonight.lua +return function() + require('tokyonight').setup { + style = 'moon', + transparent = false, + } + vim.cmd.colorscheme 'tokyonight' +end