diff --git a/init.lua b/init.lua index 6c6ae020bcd..b285d3392d2 100644 --- a/init.lua +++ b/init.lua @@ -188,18 +188,27 @@ require('lazy').setup({ end, }, }, - + -- { + -- -- Theme inspired by Atom + -- 'navarasu/onedark.nvim', + -- priority = 1000, + -- lazy = false, + -- config = function() + -- require('onedark').setup { + -- -- Set a style preset. 'dark' is default. + -- style = 'warm', -- dark, darker, cool, deep, warm, warmer, light + -- } + -- require('onedark').load() + -- end, + -- }, { -- Theme inspired by Atom - 'navarasu/onedark.nvim', - priority = 1000, - lazy = false, + 'rebelot/kanagawa.nvim', config = function() - require('onedark').setup { - -- Set a style preset. 'dark' is default. - style = 'dark', -- dark, darker, cool, deep, warm, warmer, light + require('kanagawa').setup { + theme = 'dragon', -- wave, dragon, lotus } - require('onedark').load() + require('kanagawa').load() end, }, @@ -271,7 +280,7 @@ require('lazy').setup({ -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, }, {}) -- [[ Setting options ]] @@ -284,6 +293,9 @@ vim.o.hlsearch = false -- Make line numbers default vim.wo.number = true +-- Make relative numbers default +vim.wo.relativenumber = true + -- Enable mouse mode vim.o.mouse = 'a' @@ -315,6 +327,8 @@ vim.o.completeopt = 'menuone,noselect' -- NOTE: You should make sure your terminal supports this vim.o.termguicolors = true +vim.o.shiftwidth = 4 +vim.o.tabstop = 4 -- [[ Basic Keymaps ]] -- Keymaps for better default experience @@ -346,6 +360,7 @@ vim.api.nvim_create_autocmd('TextYankPost', { -- See `:help telescope` and `:help telescope.setup()` require('telescope').setup { defaults = { + vimgrep_arguments = { 'rg', '--hidden', '--color=never', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case' }, mappings = { i = { [''] = false, @@ -535,6 +550,14 @@ local on_attach = function(_, bufnr) print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, '[W]orkspace [L]ist Folders') + -- Add key map for organising imports + nmap('li', function() + vim.lsp.buf.execute_command({ + command = "_typescript.organizeImports", + arguments = {vim.api.nvim_buf_get_name(0)}, + }) + end, '[L]ay Out [I]mports') + -- Create a command `:Format` local to the LSP buffer vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_) vim.lsp.buf.format() @@ -577,9 +600,10 @@ local servers = { -- gopls = {}, -- pyright = {}, -- rust_analyzer = {}, - -- tsserver = {}, -- html = { filetypes = { 'html', 'twig', 'hbs'} }, - + -- phpactor = {}, + tsserver = {}, + intelephense = {}, lua_ls = { Lua = { workspace = { checkThirdParty = false }, diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 00000000000..127e4d042ee --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,33 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "LuaSnip": { "branch": "master", "commit": "2dbef19461198630b3d7c39f414d09fb07d1fdd2" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "fidget.nvim": { "branch": "main", "commit": "1d1042d418ee8cb70d68f1e38db639844331c093" }, + "friendly-snippets": { "branch": "main", "commit": "b8fae73a479ae0a1c54f5c98fa687ae8a0addc53" }, + "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, + "indent-blankline.nvim": { "branch": "master", "commit": "12e92044d313c54c438bd786d11684c88f6f78cd" }, + "kanagawa.nvim": { "branch": "master", "commit": "c19b9023842697ec92caf72cd3599f7dd7be4456" }, + "lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" }, + "lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "2b3d247fce06f53934174f5dfe0362c42d65c00c" }, + "mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" }, + "neo-tree.nvim": { "branch": "main", "commit": "2f2d08894bbc679d4d181604c16bb7079f646384" }, + "neodev.nvim": { "branch": "main", "commit": "2793ba3127c2c93ee486b9072a3ef129eeb950cc" }, + "nui.nvim": { "branch": "main", "commit": "35da9ca1de0fc4dda96c2e214d93d363c145f418" }, + "nvim-autopairs": { "branch": "master", "commit": "9fd41181693dd4106b3e414a822bb6569924de81" }, + "nvim-cmp": { "branch": "main", "commit": "538e37ba87284942c1d76ed38dd497e54e65b891" }, + "nvim-lspconfig": { "branch": "master", "commit": "ac530dfb97e51d82e3b0a7cddbf7a4a7c4c10ff8" }, + "nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" }, + "nvim-treesitter": { "branch": "master", "commit": "e7ea07e42c478cb466cf96124693b447add84011" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "8edd5a6d96936bdff23333d3bc177481388839e5" }, + "nvim-web-devicons": { "branch": "master", "commit": "140edfcf25093e8b321d13e154cbce89ee868ca0" }, + "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, + "vim-fugitive": { "branch": "master", "commit": "f116dcc8e21021e6fbfb6b0a9f8f7b9566d933f4" }, + "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, + "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, + "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } +} \ No newline at end of file diff --git a/lua/custom/plugins/autopairs.lua b/lua/custom/plugins/autopairs.lua new file mode 100644 index 00000000000..3f3d9789419 --- /dev/null +++ b/lua/custom/plugins/autopairs.lua @@ -0,0 +1,17 @@ +-- File: lua/custom/plugins/autopairs.lua + +return { + "windwp/nvim-autopairs", + -- Optional dependency + dependencies = { 'hrsh7th/nvim-cmp' }, + config = function() + require("nvim-autopairs").setup {} + -- If you want to automatically add `(` after selecting a function or method + local cmp_autopairs = require('nvim-autopairs.completion.cmp') + local cmp = require('cmp') + cmp.event:on( + 'confirm_done', + cmp_autopairs.on_confirm_done() + ) + end, +} diff --git a/lua/custom/plugins/filetree.lua b/lua/custom/plugins/filetree.lua new file mode 100644 index 00000000000..e1e397b32ab --- /dev/null +++ b/lua/custom/plugins/filetree.lua @@ -0,0 +1,27 @@ +-- Unless you are still migrating, remove the deprecated commands from v1.x +vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) + +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", + }, + config = function () + require('neo-tree').setup { + default_component_configs = { + icon = { + folder_closed = "", + folder_open = "", + folder_empty = "󰜌", + -- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there + -- then these will never be used. + default = "*", + highlight = "NeoTreeFileIcon" + }, + } + } + end, +} diff --git a/lua/custom/plugins/scrollbar.lua b/lua/custom/plugins/scrollbar.lua new file mode 100644 index 00000000000..a59d54e7975 --- /dev/null +++ b/lua/custom/plugins/scrollbar.lua @@ -0,0 +1,6 @@ +return { + "petertriho/nvim-scrollbar", + config = function() + require("scrollbar").setup {} + end, +}