From 413d04d444cb113b52f50a248b8552c0c46a5c4f Mon Sep 17 00:00:00 2001 From: tawfeeq Date: Wed, 24 Jul 2024 18:07:03 +0200 Subject: [PATCH] With working terraformls, autocompletion and comments --- init.lua | 157 +++++++++----- lua/custom/plugins/alpha-nvim.lua | 31 +++ lua/custom/plugins/ayu.lua | 9 + lua/custom/plugins/bamboo.lua | 10 + lua/custom/plugins/catppuccin.lua | 1 + lua/custom/plugins/comment.nvim.lua | 6 + lua/custom/plugins/completions.lua | 1 + lua/custom/plugins/fahrenheit.lua | 1 + lua/custom/plugins/gruvbox-material.lua | 1 + lua/custom/plugins/gruvbox.lua | 1 + lua/custom/plugins/kanagawa.lua | 1 + lua/custom/plugins/material.lua | 1 + lua/custom/plugins/mellow.lua | 1 + lua/custom/plugins/miasma.lua | 5 + lua/custom/plugins/miramare.lua | 2 + lua/custom/plugins/neotree.lua | 245 ++++++++++++++++++++++ lua/custom/plugins/nord.lua | 3 + lua/custom/plugins/nvim-colorizer.lua | 1 + lua/custom/plugins/nvim-nio.lua | 1 + lua/custom/plugins/rainbow-delimeters.lua | 2 + lua/custom/plugins/rosepine.lua | 1 + lua/custom/plugins/tomorrow-theme.lua | 3 + lua/custom/plugins/typescript-tools.lua | 5 + lua/custom/plugins/ultimate-autopair.lua | 8 + 24 files changed, 447 insertions(+), 50 deletions(-) create mode 100644 lua/custom/plugins/alpha-nvim.lua create mode 100644 lua/custom/plugins/ayu.lua create mode 100644 lua/custom/plugins/bamboo.lua create mode 100644 lua/custom/plugins/catppuccin.lua create mode 100644 lua/custom/plugins/comment.nvim.lua create mode 100644 lua/custom/plugins/completions.lua create mode 100644 lua/custom/plugins/fahrenheit.lua create mode 100644 lua/custom/plugins/gruvbox-material.lua create mode 100644 lua/custom/plugins/gruvbox.lua create mode 100644 lua/custom/plugins/kanagawa.lua create mode 100644 lua/custom/plugins/material.lua create mode 100644 lua/custom/plugins/mellow.lua create mode 100644 lua/custom/plugins/miasma.lua create mode 100644 lua/custom/plugins/miramare.lua create mode 100644 lua/custom/plugins/neotree.lua create mode 100644 lua/custom/plugins/nord.lua create mode 100644 lua/custom/plugins/nvim-colorizer.lua create mode 100644 lua/custom/plugins/nvim-nio.lua create mode 100644 lua/custom/plugins/rainbow-delimeters.lua create mode 100644 lua/custom/plugins/rosepine.lua create mode 100644 lua/custom/plugins/tomorrow-theme.lua create mode 100644 lua/custom/plugins/typescript-tools.lua create mode 100644 lua/custom/plugins/ultimate-autopair.lua diff --git a/init.lua b/init.lua index 88658ef3..5908cdda 100644 --- a/init.lua +++ b/init.lua @@ -81,12 +81,53 @@ If you experience any errors while trying to install kickstart, run `:checkhealt I hope you enjoy your Neovim journey, - TJ + +-- Set as the leader key +-- See `:help mapleader` +-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) + +-- Set as the leader key +-- See `:help mapleader` +-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) P.S. You can delete this when you're done too. It's your config now! :) --]] -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) + +vim.o.autoread = true +vim.api.nvim_create_autocmd('BufEnter', { + group = vim.api.nvim_create_augroup('lazyvim_auto_reload', { clear = true }), + pattern = '*', + command = 'checktime', +}) +-- Ensure Neovim recognizes .tf and .tfvars files as terraform +-- vim.filetype.add { +-- extension = { +-- tf = 'terraform', +-- tfvars = 'terraform', -- Include .tfvars files +-- }, +-- } +-- Refresh Neovim +vim.api.nvim_set_keymap('n', 'rr', ':lua os.exit(1)', { noremap = true, silent = true }) +-- Add custom key bindings +vim.api.nvim_set_keymap('i', '', '', { noremap = true }) +vim.api.nvim_set_keymap('i', '', '', { noremap = true }) +vim.api.nvim_set_keymap('i', '', '$', { noremap = true }) +vim.api.nvim_set_keymap('i', '', '^', { noremap = true }) +vim.api.nvim_set_keymap('i', '', 'opi', { noremap = true }) +vim.api.nvim_set_keymap('i', '', 'oPi', { noremap = true }) +-- Block cursor +vim.opt.guicursor = + 'n-v-c:block,i-ci-ve:block,r-cr:hor20,o:hor50,i-ci-ve:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,sm:block-blinkwait175-blinkoff150-blinkon175' + +-------------------------------------------------------------------- + +if vim.fn.has 'termguicolors' == 1 then + vim.opt.termguicolors = true +end + vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' @@ -162,9 +203,6 @@ vim.opt.hlsearch = true vim.keymap.set('n', '', 'nohlsearch') -- Diagnostic keymaps -vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' }) -vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' }) -vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' }) 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 @@ -207,9 +245,12 @@ vim.api.nvim_create_autocmd('TextYankPost', { -- [[ 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.loop.fs_stat(lazypath) then +if not vim.uv.fs_stat(lazypath) then local lazyrepo = 'https://github.com/folke/lazy.nvim.git' - vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath } + 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 end ---@diagnostic disable-next-line: undefined-field vim.opt.rtp:prepend(lazypath) @@ -233,13 +274,6 @@ require('lazy').setup({ -- keys can be used to configure plugin behavior/loading/etc. -- -- Use `opts = {}` to force a plugin to be loaded. - -- - -- This is equivalent to: - -- require('Comment').setup({}) - - -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, - -- Here is a more advanced example where we pass configuration -- options to `gitsigns.nvim`. This is equivalent to the following Lua: -- require('gitsigns').setup({ ... }) @@ -280,19 +314,15 @@ require('lazy').setup({ require('which-key').setup() -- Document existing key chains - require('which-key').register { - ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, - ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, - ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, - ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, - ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, - ['t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, - ['h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' }, + require('which-key').add { + { 'c', group = '[C]ode' }, + { 'd', group = '[D]ocument' }, + { 'r', group = '[R]ename' }, + { 's', group = '[S]earch' }, + { 'w', group = '[W]orkspace' }, + { 't', group = '[T]oggle' }, + { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, } - -- visual mode - require('which-key').register({ - ['h'] = { 'Git [H]unk' }, - }, { mode = 'v' }) end, }, @@ -413,20 +443,44 @@ require('lazy').setup({ dependencies = { -- Automatically install LSPs and related tools to stdpath for Neovim { 'williamboman/mason.nvim', config = true }, -- NOTE: Must be loaded before dependants - 'williamboman/mason-lspconfig.nvim', + { 'williamboman/mason-lspconfig.nvim' }, + 'WhoIsSethDaniel/mason-tool-installer.nvim', -- Useful status updates for LSP. -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` { 'j-hui/fidget.nvim', opts = {} }, - -- `neodev` configures Lua LSP for your Neovim config, runtime and plugins + -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins -- used for completion, annotations and signatures of Neovim apis - { 'folke/neodev.nvim', opts = {} }, + { + 'folke/lazydev.nvim', + ft = 'lua', + opts = { + library = { + -- Load luvit types when the `vim.uv` word is found + { path = 'luvit-meta/library', words = { 'vim%.uv' } }, + }, + }, + }, + { 'Bilal2453/luvit-meta', lazy = true }, }, config = function() - -- Brief aside: **What is LSP?** - -- + local lspconfig = require 'lspconfig' + local util = require 'lspconfig/util' + + -- Mason setup to ensure terraform-ls is installed + require('mason-lspconfig').setup { + ensure_installed = { 'terraformls', 'tflint' }, + } + + require('lspconfig').terraformls.setup {} + vim.api.nvim_create_autocmd({ 'BufWritePre' }, { + pattern = { '*.tf', '*.tfvars' }, + callback = function() + vim.lsp.buf.format() + end, + }) -- LSP is an initialism you've probably heard, but might not understand what it is. -- -- LSP stands for Language Server Protocol. It's a protocol that helps editors @@ -499,10 +553,6 @@ require('lazy').setup({ -- or a suggestion from your LSP for this to activate. map('ca', vim.lsp.buf.code_action, '[C]ode [A]ction') - -- Opens a popup that displays documentation about the word under your cursor - -- See `:help K` for why this keymap. - map('K', vim.lsp.buf.hover, 'Hover Documentation') - -- WARN: This is not Goto Definition, this is Goto Declaration. -- For example, in C this would take you to the header. map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') @@ -513,7 +563,7 @@ require('lazy').setup({ -- -- When you move your cursor, the highlights will be cleared (the second autocommand). local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client.server_capabilities.documentHighlightProvider then + if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { buffer = event.buf, @@ -536,13 +586,13 @@ require('lazy').setup({ }) end - -- The following autocommand is used to enable inlay hints in your + -- The following code creates a keymap to toggle inlay hints in your -- code, if the language server you are using supports them -- -- This may be unwanted, since they displace some of your code - if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then + if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then map('th', function() - vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) end, '[T]oggle Inlay [H]ints') end end, @@ -565,17 +615,18 @@ 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 = { + -- terraformls = {}, -- clangd = {}, - -- gopls = {}, + gopls = {}, -- pyright = {}, - -- rust_analyzer = {}, + rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- -- Some languages (like typescript) have entire language plugins that can be useful: -- https://github.com/pmizio/typescript-tools.nvim -- -- But for many setups, the LSP (`tsserver`) will work just fine - -- tsserver = {}, + tsserver = {}, -- lua_ls = { @@ -627,7 +678,8 @@ require('lazy').setup({ { -- Autoformat 'stevearc/conform.nvim', - lazy = false, + event = { 'BufWritePre' }, + cmd = { 'ConformInfo' }, keys = { { 'f', @@ -657,7 +709,7 @@ require('lazy').setup({ -- -- You can use a sub-list to tell conform to run *until* a formatter -- is found. - -- javascript = { { "prettierd", "prettier" } }, + javascript = { { 'prettierd', 'prettier' } }, }, }, }, @@ -765,6 +817,11 @@ require('lazy').setup({ -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps }, sources = { + { + name = 'lazydev', + -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it + group_index = 0, + }, { name = 'nvim_lsp' }, { name = 'luasnip' }, { name = 'path' }, @@ -801,7 +858,7 @@ require('lazy').setup({ -- -- Examples: -- - va) - [V]isually select [A]round [)]paren - -- - yinq - [Y]ank [I]nside [N]ext [']quote + -- - yinq - [Y]ank [I]nside [N]ext [Q]uote -- - ci' - [C]hange [I]nside [']quote require('mini.ai').setup { n_lines = 500 } @@ -835,7 +892,7 @@ require('lazy').setup({ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' }, + ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, -- Autoinstall languages that are not installed auto_install = true, highlight = { @@ -873,19 +930,19 @@ require('lazy').setup({ -- 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.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 recommend keymaps + 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. -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, }, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the diff --git a/lua/custom/plugins/alpha-nvim.lua b/lua/custom/plugins/alpha-nvim.lua new file mode 100644 index 00000000..81eed88f --- /dev/null +++ b/lua/custom/plugins/alpha-nvim.lua @@ -0,0 +1,31 @@ +return { + 'goolord/alpha-nvim', + dependencies = { + 'nvim-tree/nvim-web-devicons', + }, + + config = function() + local alpha = require 'alpha' + local dashboard = require 'alpha.themes.startify' + + dashboard.section.header.val = { + [[ ]], + [[ ]], + [[ ]], + [[ ]], + [[  ]], + [[ ████ ██████ █████ ██ ]], + [[ ███████████ █████  ]], + [[ █████████ ███████████████████ ███ ███████████ ]], + [[ █████████ ███ █████████████ █████ ██████████████ ]], + [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], + [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], + [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], + [[ ]], + [[ ]], + [[ ]], + } + + alpha.setup(dashboard.opts) + end, +} diff --git a/lua/custom/plugins/ayu.lua b/lua/custom/plugins/ayu.lua new file mode 100644 index 00000000..27ba4e94 --- /dev/null +++ b/lua/custom/plugins/ayu.lua @@ -0,0 +1,9 @@ +return { + 'ayu-theme/ayu-vim', -- or other package manager + config = function() + vim.o.termguicolors = true -- enable true colors support + local ayucolor = 'light' -- for light version of theme + -- local ayucolor = 'mirage' -- for mirage version of theme + -- local ayucolor = 'dark' -- for dark version of theme + end, +} diff --git a/lua/custom/plugins/bamboo.lua b/lua/custom/plugins/bamboo.lua new file mode 100644 index 00000000..c71c25f8 --- /dev/null +++ b/lua/custom/plugins/bamboo.lua @@ -0,0 +1,10 @@ +return -- Using lazy.nvim +{ + 'ribru17/bamboo.nvim', + lazy = false, + config = function() + require('bamboo').setup { + -- optional configuration here + } + end, +} diff --git a/lua/custom/plugins/catppuccin.lua b/lua/custom/plugins/catppuccin.lua new file mode 100644 index 00000000..cada0631 --- /dev/null +++ b/lua/custom/plugins/catppuccin.lua @@ -0,0 +1 @@ +return { 'catppuccin/nvim', name = 'catppuccin', priority = 1000 } diff --git a/lua/custom/plugins/comment.nvim.lua b/lua/custom/plugins/comment.nvim.lua new file mode 100644 index 00000000..98239ad4 --- /dev/null +++ b/lua/custom/plugins/comment.nvim.lua @@ -0,0 +1,6 @@ +return { + 'numToStr/Comment.nvim', + opts = { + -- add any options here + }, +} diff --git a/lua/custom/plugins/completions.lua b/lua/custom/plugins/completions.lua new file mode 100644 index 00000000..a5647075 --- /dev/null +++ b/lua/custom/plugins/completions.lua @@ -0,0 +1 @@ +return {} diff --git a/lua/custom/plugins/fahrenheit.lua b/lua/custom/plugins/fahrenheit.lua new file mode 100644 index 00000000..ea8a9baf --- /dev/null +++ b/lua/custom/plugins/fahrenheit.lua @@ -0,0 +1 @@ +return { 'fcpg/vim-fahrenheit' } diff --git a/lua/custom/plugins/gruvbox-material.lua b/lua/custom/plugins/gruvbox-material.lua new file mode 100644 index 00000000..bf9964c4 --- /dev/null +++ b/lua/custom/plugins/gruvbox-material.lua @@ -0,0 +1 @@ +return { 'sainnhe/gruvbox-material' } diff --git a/lua/custom/plugins/gruvbox.lua b/lua/custom/plugins/gruvbox.lua new file mode 100644 index 00000000..5c9faf09 --- /dev/null +++ b/lua/custom/plugins/gruvbox.lua @@ -0,0 +1 @@ +return { 'ellisonleao/gruvbox.nvim' } diff --git a/lua/custom/plugins/kanagawa.lua b/lua/custom/plugins/kanagawa.lua new file mode 100644 index 00000000..c52ff3df --- /dev/null +++ b/lua/custom/plugins/kanagawa.lua @@ -0,0 +1 @@ +return { 'rebelot/kanagawa.nvim' } diff --git a/lua/custom/plugins/material.lua b/lua/custom/plugins/material.lua new file mode 100644 index 00000000..359ebe63 --- /dev/null +++ b/lua/custom/plugins/material.lua @@ -0,0 +1 @@ +return { 'marko-cerovac/material.nvim' } diff --git a/lua/custom/plugins/mellow.lua b/lua/custom/plugins/mellow.lua new file mode 100644 index 00000000..77f93f1e --- /dev/null +++ b/lua/custom/plugins/mellow.lua @@ -0,0 +1 @@ +return { 'mellow-theme/mellow.nvim' } diff --git a/lua/custom/plugins/miasma.lua b/lua/custom/plugins/miasma.lua new file mode 100644 index 00000000..0c3bd050 --- /dev/null +++ b/lua/custom/plugins/miasma.lua @@ -0,0 +1,5 @@ +return { + 'xero/miasma.nvim', + lazy = false, + priority = 1000, +} diff --git a/lua/custom/plugins/miramare.lua b/lua/custom/plugins/miramare.lua new file mode 100644 index 00000000..7c6846f4 --- /dev/null +++ b/lua/custom/plugins/miramare.lua @@ -0,0 +1,2 @@ +-- theme +return { 'franbach/miramare' } diff --git a/lua/custom/plugins/neotree.lua b/lua/custom/plugins/neotree.lua new file mode 100644 index 00000000..993a8dac --- /dev/null +++ b/lua/custom/plugins/neotree.lua @@ -0,0 +1,245 @@ +return { + { + 'nvim-neo-tree/neo-tree.nvim', + branch = 'v3.x', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended + 'MunifTanjim/nui.nvim', + { + 's1n7ax/nvim-window-picker', + version = '2.*', + config = function() + require('window-picker').setup { + filter_rules = { + include_current_win = false, + autoselect_one = true, + bo = { + filetype = { 'neo-tree', 'neo-tree-popup', 'notify' }, + buftype = { 'terminal', 'quickfix' }, + }, + }, + } + end, + }, + }, + config = function() + vim.fn.sign_define('DiagnosticSignError', { text = ' ', texthl = 'DiagnosticSignError' }) + vim.fn.sign_define('DiagnosticSignWarn', { text = ' ', texthl = 'DiagnosticSignWarn' }) + vim.fn.sign_define('DiagnosticSignInfo', { text = ' ', texthl = 'DiagnosticSignInfo' }) + vim.fn.sign_define('DiagnosticSignHint', { text = '󰌵', texthl = 'DiagnosticSignHint' }) + + require('neo-tree').setup { + close_if_last_window = false, + popup_border_style = 'rounded', + enable_git_status = true, + enable_diagnostics = true, + open_files_do_not_replace_types = { 'terminal', 'trouble', 'qf' }, + sort_case_insensitive = false, + sort_function = nil, + default_component_configs = { + container = { + enable_character_fade = true, + }, + indent = { + indent_size = 2, + padding = 1, + with_markers = true, + indent_marker = '│', + last_indent_marker = '└', + highlight = 'NeoTreeIndentMarker', + with_expanders = nil, + expander_collapsed = '', + expander_expanded = '', + expander_highlight = 'NeoTreeExpander', + }, + icon = { + folder_closed = '', + folder_open = '', + folder_empty = '󰜌', + default = '*', + highlight = 'NeoTreeFileIcon', + }, + modified = { + symbol = '[+]', + highlight = 'NeoTreeModified', + }, + name = { + trailing_slash = false, + use_git_status_colors = true, + highlight = 'NeoTreeFileName', + }, + git_status = { + symbols = { + added = '', + modified = '', + deleted = '✖', + renamed = '󰁕', + untracked = '', + ignored = '', + unstaged = '󰄱', + staged = '', + conflict = '', + }, + }, + file_size = { + enabled = true, + required_width = 64, + }, + type = { + enabled = true, + required_width = 122, + }, + last_modified = { + enabled = true, + required_width = 88, + }, + created = { + enabled = true, + required_width = 110, + }, + symlink_target = { + enabled = false, + }, + }, + commands = {}, + window = { + position = 'left', + width = 40, + mapping_options = { + noremap = true, + nowait = true, + }, + mappings = { + [''] = { 'toggle_node', nowait = false }, + ['<2-LeftMouse>'] = 'open', + [''] = 'open', + [''] = 'cancel', + ['P'] = { 'toggle_preview', config = { use_float = true, use_image_nvim = true } }, + ['l'] = 'focus_preview', + ['S'] = 'open_split', + ['s'] = 'open_vsplit', + ['t'] = 'open_tabnew', + ['w'] = 'open_with_window_picker', + ['C'] = 'close_node', + ['z'] = 'close_all_nodes', + ['a'] = { + 'add', + config = { + show_path = 'none', + }, + }, + ['A'] = 'add_directory', + ['d'] = 'delete', + ['r'] = 'rename', + ['y'] = 'copy_to_clipboard', + ['x'] = 'cut_to_clipboard', + ['p'] = 'paste_from_clipboard', + ['c'] = 'copy', + ['m'] = 'move', + ['q'] = 'close_window', + ['R'] = 'refresh', + ['?'] = 'show_help', + ['<'] = 'prev_source', + ['>'] = 'next_source', + ['i'] = 'show_file_details', + }, + }, + nesting_rules = {}, + filesystem = { + filtered_items = { + visible = false, + hide_dotfiles = true, + hide_gitignored = true, + hide_hidden = true, + hide_by_name = {}, + hide_by_pattern = {}, + always_show = {}, + never_show = {}, + never_show_by_pattern = {}, + }, + follow_current_file = { + enabled = false, + leave_dirs_open = false, + }, + group_empty_dirs = false, + hijack_netrw_behavior = 'open_default', + use_libuv_file_watcher = false, + window = { + mappings = { + [''] = 'navigate_up', + ['.'] = 'set_root', + ['H'] = 'toggle_hidden', + ['/'] = 'fuzzy_finder', + ['D'] = 'fuzzy_finder_directory', + ['#'] = 'fuzzy_sorter', + ['f'] = 'filter_on_submit', + [''] = 'clear_filter', + ['[g'] = 'prev_git_modified', + [']g'] = 'next_git_modified', + ['o'] = { 'show_help', nowait = false, config = { title = 'Order by', prefix_key = 'o' } }, + ['oc'] = { 'order_by_created', nowait = false }, + ['od'] = { 'order_by_diagnostics', nowait = false }, + ['om'] = { 'order_by_modified', nowait = false }, + ['on'] = { 'order_by_name', nowait = false }, + ['os'] = { 'order_by_size', nowait = false }, + ['ot'] = { 'order_by_type', nowait = false }, + }, + fuzzy_finder_mappings = { + [''] = 'move_cursor_down', + [''] = 'move_cursor_down', + [''] = 'move_cursor_up', + [''] = 'move_cursor_up', + }, + }, + commands = {}, + }, + buffers = { + follow_current_file = { + enabled = true, + leave_dirs_open = false, + }, + group_empty_dirs = true, + show_unloaded = true, + window = { + mappings = { + ['bd'] = 'buffer_delete', + [''] = 'navigate_up', + ['.'] = 'set_root', + ['o'] = { 'show_help', nowait = false, config = { title = 'Order by', prefix_key = 'o' } }, + ['oc'] = { 'order_by_created', nowait = false }, + ['od'] = { 'order_by_diagnostics', nowait = false }, + ['om'] = { 'order_by_modified', nowait = false }, + ['on'] = { 'order_by_name', nowait = false }, + ['os'] = { 'order_by_size', nowait = false }, + ['ot'] = { 'order_by_type', nowait = false }, + }, + }, + }, + git_status = { + window = { + position = 'float', + mappings = { + ['A'] = 'git_add_all', + ['gu'] = 'git_unstage_file', + ['ga'] = 'git_add_file', + ['gr'] = 'git_revert_file', + ['gc'] = 'git_commit', + ['gp'] = 'git_push', + ['gg'] = 'git_commit_and_push', + ['o'] = { 'show_help', nowait = false, config = { title = 'Order by', prefix_key = 'o' } }, + ['oc'] = { 'order_by_created', nowait = false }, + ['od'] = { 'order_by_diagnostics', nowait = false }, + ['om'] = { 'order_by_modified', nowait = false }, + ['on'] = { 'order_by_name', nowait = false }, + ['os'] = { 'order_by_size', nowait = false }, + ['ot'] = { 'order_by_type', nowait = false }, + }, + }, + }, + } + + vim.cmd [[nnoremap \ :Neotree reveal]] + end, + }, +} diff --git a/lua/custom/plugins/nord.lua b/lua/custom/plugins/nord.lua new file mode 100644 index 00000000..8504c878 --- /dev/null +++ b/lua/custom/plugins/nord.lua @@ -0,0 +1,3 @@ +return { +'shaunsingh/nord.nvim' +} diff --git a/lua/custom/plugins/nvim-colorizer.lua b/lua/custom/plugins/nvim-colorizer.lua new file mode 100644 index 00000000..b76ab772 --- /dev/null +++ b/lua/custom/plugins/nvim-colorizer.lua @@ -0,0 +1 @@ +return { 'norcalli/nvim-colorizer.lua' } diff --git a/lua/custom/plugins/nvim-nio.lua b/lua/custom/plugins/nvim-nio.lua new file mode 100644 index 00000000..e5891bc7 --- /dev/null +++ b/lua/custom/plugins/nvim-nio.lua @@ -0,0 +1 @@ +return { 'nvim-neotest/nvim-nio' } diff --git a/lua/custom/plugins/rainbow-delimeters.lua b/lua/custom/plugins/rainbow-delimeters.lua new file mode 100644 index 00000000..3cc0819d --- /dev/null +++ b/lua/custom/plugins/rainbow-delimeters.lua @@ -0,0 +1,2 @@ +-- return { 'HiPhish/rainbow-delimiters.nvim' } +return {} diff --git a/lua/custom/plugins/rosepine.lua b/lua/custom/plugins/rosepine.lua new file mode 100644 index 00000000..88797187 --- /dev/null +++ b/lua/custom/plugins/rosepine.lua @@ -0,0 +1 @@ +return { 'rose-pine/neovim', as = 'rose-pine' } diff --git a/lua/custom/plugins/tomorrow-theme.lua b/lua/custom/plugins/tomorrow-theme.lua new file mode 100644 index 00000000..bb644927 --- /dev/null +++ b/lua/custom/plugins/tomorrow-theme.lua @@ -0,0 +1,3 @@ +return { + 'timmajani/tokyonightnoir-vim', +} diff --git a/lua/custom/plugins/typescript-tools.lua b/lua/custom/plugins/typescript-tools.lua new file mode 100644 index 00000000..ba7fb204 --- /dev/null +++ b/lua/custom/plugins/typescript-tools.lua @@ -0,0 +1,5 @@ +return { + 'pmizio/typescript-tools.nvim', + dependencies = { 'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig' }, + opts = {}, +} diff --git a/lua/custom/plugins/ultimate-autopair.lua b/lua/custom/plugins/ultimate-autopair.lua new file mode 100644 index 00000000..72c19685 --- /dev/null +++ b/lua/custom/plugins/ultimate-autopair.lua @@ -0,0 +1,8 @@ +return { + 'altermo/ultimate-autopair.nvim', + event = { 'InsertEnter', 'CmdlineEnter' }, + branch = 'v0.6', --recommended as each new version will have breaking changes + opts = { + --Config goes here + }, +}