@@ -156,11 +156,13 @@ vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
156
156
vim .o .inccommand = ' split'
157
157
158
158
-- Show which line your cursor is on
159
- vim .o .cursorline = true
159
+ vim .opt .cursorline = false
160
160
161
161
-- Minimal number of screen lines to keep above and below the cursor.
162
162
vim .o .scrolloff = 10
163
163
164
+ vim .o .tabstop = 4
165
+
164
166
-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
165
167
-- instead raise a dialog asking if you wish to save the current file(s)
166
168
-- See `:help 'confirm'`
@@ -174,6 +176,7 @@ vim.o.confirm = true
174
176
vim .keymap .set (' n' , ' <Esc>' , ' <cmd>nohlsearch<CR>' )
175
177
176
178
-- Diagnostic keymaps
179
+ vim .keymap .set (' n' , ' <leader>d' , vim .diagnostic .open_float , { desc = ' Show [D]iagnostic under cursor' })
177
180
vim .keymap .set (' n' , ' <leader>q' , vim .diagnostic .setloclist , { desc = ' Open diagnostic [Q]uickfix list' })
178
181
179
182
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
@@ -247,7 +250,8 @@ rtp:prepend(lazypath)
247
250
-- NOTE: Here is where you install your plugins.
248
251
require (' lazy' ).setup ({
249
252
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
250
- ' NMAC427/guess-indent.nvim' , -- Detect tabstop and shiftwidth automatically
253
+ -- I found that I needed to set opts = {} or it wouldn't load the plugin.
254
+ { ' NMAC427/guess-indent.nvim' , opts = {} }, -- Detect tabstop and shiftwidth automatically
251
255
252
256
-- NOTE: Plugins can also be added by using a table,
253
257
-- with the first argument being the link and the following
@@ -435,6 +439,8 @@ require('lazy').setup({
435
439
vim .keymap .set (' n' , ' <leader>sd' , builtin .diagnostics , { desc = ' [S]earch [D]iagnostics' })
436
440
vim .keymap .set (' n' , ' <leader>sr' , builtin .resume , { desc = ' [S]earch [R]esume' })
437
441
vim .keymap .set (' n' , ' <leader>s.' , builtin .oldfiles , { desc = ' [S]earch Recent Files ("." for repeat)' })
442
+ vim .keymap .set (' n' , ' <leader>gs' , builtin .git_status , { desc = ' [G]it [S]tatus' })
443
+ vim .keymap .set (' n' , ' <leader>gd' , ' <cmd>Gvdiffsplit<CR>' , { desc = ' [G]it [D]iff' })
438
444
vim .keymap .set (' n' , ' <leader><leader>' , builtin .buffers , { desc = ' [ ] Find existing buffers' })
439
445
440
446
-- Slightly advanced example of overriding default behavior and theme
@@ -472,18 +478,21 @@ require('lazy').setup({
472
478
library = {
473
479
-- Load luvit types when the `vim.uv` word is found
474
480
{ path = ' ${3rd}/luv/library' , words = { ' vim%.uv' } },
481
+ -- { path = 'luvit-meta/library', words = { 'vim%.uv' } },
475
482
},
476
483
},
477
484
},
485
+ -- { 'Bilal2453/luvit-meta', lazy = true },
478
486
{
479
487
-- Main LSP Configuration
480
488
' neovim/nvim-lspconfig' ,
481
489
dependencies = {
482
490
-- Automatically install LSPs and related tools to stdpath for Neovim
483
491
-- Mason must be loaded before its dependents so we need to set it up here.
484
492
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
485
- { ' mason-org/mason.nvim' , opts = {} },
486
- ' mason-org/mason-lspconfig.nvim' ,
493
+ -- { 'williamboman/mason.nvim', config = true }, -- NOTE: Must be loaded before dependants
494
+ { ' mason-org/mason.nvim' , version = ' 1.*' , opts = {} },
495
+ { ' mason-org/mason-lspconfig.nvim' , version = ' 1.*' },
487
496
' WhoIsSethDaniel/mason-tool-installer.nvim' ,
488
497
489
498
-- Useful status updates for LSP.
@@ -698,6 +707,44 @@ require('lazy').setup({
698
707
},
699
708
},
700
709
},
710
+
711
+ denols = {
712
+ root_dir = require (' lspconfig' ).util .root_pattern (' deno.json' , ' deno.jsonc' ),
713
+ },
714
+
715
+ ts_ls = {
716
+ root_dir = require (' lspconfig' ).util .root_pattern ' package.json' ,
717
+ single_file_support = false ,
718
+ },
719
+
720
+ pylsp = {
721
+ settings = {
722
+ pylsp = {
723
+ plugins = {
724
+ mypy = {
725
+ enabled = true ,
726
+ live_mode = false ,
727
+ strict = false ,
728
+ },
729
+ ruff = {
730
+ enabled = true ,
731
+ lineLength = 88 ,
732
+ },
733
+ -- Disable other plugins since ruff and mypy will handle most things
734
+ pycodestyle = { enabled = false },
735
+ pyflakes = { enabled = false },
736
+ mccabe = { enabled = false },
737
+ pylint = { enabled = false },
738
+ flake8 = { enabled = false },
739
+ },
740
+ },
741
+ },
742
+ },
743
+
744
+ -- emmet_language_server = {},
745
+ -- postgres_lsp = {},
746
+ -- prettier = {},
747
+ -- sqlls = {},
701
748
}
702
749
703
750
-- Ensure the servers and tools above are installed
@@ -713,15 +760,17 @@ require('lazy').setup({
713
760
--
714
761
-- You can add other tools here that you want Mason to install
715
762
-- for you, so that they are available from within Neovim.
716
- local ensure_installed = vim .tbl_keys (servers or {})
717
- vim . list_extend ( ensure_installed , {
763
+ -- local ensure_installed = vim.tbl_keys(servers or {})
764
+ local ensure_installed = {
718
765
' stylua' , -- Used to format Lua code
719
- })
766
+ -- 'postgrestools',
767
+ }
720
768
require (' mason-tool-installer' ).setup { ensure_installed = ensure_installed }
721
769
722
770
require (' mason-lspconfig' ).setup {
723
771
ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
724
772
automatic_installation = false ,
773
+ -- automatic_enable = false,
725
774
handlers = {
726
775
function (server_name )
727
776
local server = servers [server_name ] or {}
@@ -733,6 +782,8 @@ require('lazy').setup({
733
782
end ,
734
783
},
735
784
}
785
+
786
+ -- vim.lsp.enable 'postgres_lsp'
736
787
end ,
737
788
},
738
789
@@ -768,6 +819,9 @@ require('lazy').setup({
768
819
end ,
769
820
formatters_by_ft = {
770
821
lua = { ' stylua' },
822
+ javascript = { ' prettier' },
823
+ -- typescript = { 'prettier' },
824
+ -- python = { 'ruff' },
771
825
-- Conform can also run multiple formatters sequentially
772
826
-- python = { "isort", "black" },
773
827
--
@@ -854,7 +908,7 @@ require('lazy').setup({
854
908
},
855
909
856
910
sources = {
857
- default = { ' lsp' , ' path' , ' snippets' , ' lazydev' },
911
+ default = { ' lsp' , ' path' , ' snippets' , ' lazydev' , ' buffer ' },
858
912
providers = {
859
913
lazydev = { module = ' lazydev.integrations.blink' , score_offset = 100 },
860
914
},
@@ -895,6 +949,9 @@ require('lazy').setup({
895
949
-- Like many other themes, this one has different styles, and you could load
896
950
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
897
951
vim .cmd .colorscheme ' tokyonight-night'
952
+
953
+ -- You can configure highlights by doing something like:
954
+ -- vim.cmd.hi 'Comment gui=none'
898
955
end ,
899
956
},
900
957
@@ -934,6 +991,8 @@ require('lazy').setup({
934
991
return ' %2l:%-2v'
935
992
end
936
993
994
+ require (' mini.pairs' ).setup ()
995
+
937
996
-- ... and there is more!
938
997
-- Check out: https://github.com/echasnovski/mini.nvim
939
998
end ,
@@ -964,6 +1023,34 @@ require('lazy').setup({
964
1023
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
965
1024
},
966
1025
1026
+ { ' mg979/vim-visual-multi' , event = ' VeryLazy' },
1027
+ { ' tpope/vim-fugitive' , event = ' VeryLazy' },
1028
+ { ' airblade/vim-rooter' , event = ' VeryLazy' },
1029
+ {
1030
+ ' nvim-tree/nvim-tree.lua' ,
1031
+ lazy = false ,
1032
+ dependencies = {
1033
+ ' nvim-tree/nvim-web-devicons' ,
1034
+ },
1035
+ config = function ()
1036
+ require (' nvim-tree' ).setup {
1037
+ sync_root_with_cwd = true ,
1038
+ update_focused_file = {
1039
+ enable = true ,
1040
+ update_root = false ,
1041
+ },
1042
+ filters = {
1043
+ git_ignored = false ,
1044
+ },
1045
+ on_attach = function (bufnr )
1046
+ local api = require ' nvim-tree.api'
1047
+ api .config .mappings .default_on_attach (bufnr )
1048
+ vim .keymap .del (' n' , ' <C-e>' , { buffer = bufnr })
1049
+ end ,
1050
+ }
1051
+ vim .keymap .set (' n' , ' <leader>n' , ' <cmd> NvimTreeToggle <CR>' , { desc = ' Toggle nvim-tree' })
1052
+ end ,
1053
+ },
967
1054
-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
968
1055
-- init.lua. If you want these files, they are in the repository, so you can just download them and
969
1056
-- place them in the correct locations.
0 commit comments