Skip to content

Commit 867066d

Browse files
committed
My local changes
1 parent 3338d39 commit 867066d

File tree

1 file changed

+95
-8
lines changed

1 file changed

+95
-8
lines changed

init.lua

Lines changed: 95 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,13 @@ vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
156156
vim.o.inccommand = 'split'
157157

158158
-- Show which line your cursor is on
159-
vim.o.cursorline = true
159+
vim.opt.cursorline = false
160160

161161
-- Minimal number of screen lines to keep above and below the cursor.
162162
vim.o.scrolloff = 10
163163

164+
vim.o.tabstop = 4
165+
164166
-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
165167
-- instead raise a dialog asking if you wish to save the current file(s)
166168
-- See `:help 'confirm'`
@@ -174,6 +176,7 @@ vim.o.confirm = true
174176
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
175177

176178
-- Diagnostic keymaps
179+
vim.keymap.set('n', '<leader>d', vim.diagnostic.open_float, { desc = 'Show [D]iagnostic under cursor' })
177180
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
178181

179182
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
@@ -247,7 +250,8 @@ rtp:prepend(lazypath)
247250
-- NOTE: Here is where you install your plugins.
248251
require('lazy').setup({
249252
-- 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
251255

252256
-- NOTE: Plugins can also be added by using a table,
253257
-- with the first argument being the link and the following
@@ -435,6 +439,8 @@ require('lazy').setup({
435439
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
436440
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
437441
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' })
438444
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
439445

440446
-- Slightly advanced example of overriding default behavior and theme
@@ -472,18 +478,21 @@ require('lazy').setup({
472478
library = {
473479
-- Load luvit types when the `vim.uv` word is found
474480
{ path = '${3rd}/luv/library', words = { 'vim%.uv' } },
481+
-- { path = 'luvit-meta/library', words = { 'vim%.uv' } },
475482
},
476483
},
477484
},
485+
-- { 'Bilal2453/luvit-meta', lazy = true },
478486
{
479487
-- Main LSP Configuration
480488
'neovim/nvim-lspconfig',
481489
dependencies = {
482490
-- Automatically install LSPs and related tools to stdpath for Neovim
483491
-- Mason must be loaded before its dependents so we need to set it up here.
484492
-- 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.*' },
487496
'WhoIsSethDaniel/mason-tool-installer.nvim',
488497

489498
-- Useful status updates for LSP.
@@ -698,6 +707,44 @@ require('lazy').setup({
698707
},
699708
},
700709
},
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 = {},
701748
}
702749

703750
-- Ensure the servers and tools above are installed
@@ -713,15 +760,17 @@ require('lazy').setup({
713760
--
714761
-- You can add other tools here that you want Mason to install
715762
-- 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 = {
718765
'stylua', -- Used to format Lua code
719-
})
766+
-- 'postgrestools',
767+
}
720768
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
721769

722770
require('mason-lspconfig').setup {
723771
ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
724772
automatic_installation = false,
773+
-- automatic_enable = false,
725774
handlers = {
726775
function(server_name)
727776
local server = servers[server_name] or {}
@@ -733,6 +782,8 @@ require('lazy').setup({
733782
end,
734783
},
735784
}
785+
786+
-- vim.lsp.enable 'postgres_lsp'
736787
end,
737788
},
738789

@@ -768,6 +819,9 @@ require('lazy').setup({
768819
end,
769820
formatters_by_ft = {
770821
lua = { 'stylua' },
822+
javascript = { 'prettier' },
823+
-- typescript = { 'prettier' },
824+
-- python = { 'ruff' },
771825
-- Conform can also run multiple formatters sequentially
772826
-- python = { "isort", "black" },
773827
--
@@ -854,7 +908,7 @@ require('lazy').setup({
854908
},
855909

856910
sources = {
857-
default = { 'lsp', 'path', 'snippets', 'lazydev' },
911+
default = { 'lsp', 'path', 'snippets', 'lazydev', 'buffer' },
858912
providers = {
859913
lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 },
860914
},
@@ -895,6 +949,9 @@ require('lazy').setup({
895949
-- Like many other themes, this one has different styles, and you could load
896950
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
897951
vim.cmd.colorscheme 'tokyonight-night'
952+
953+
-- You can configure highlights by doing something like:
954+
-- vim.cmd.hi 'Comment gui=none'
898955
end,
899956
},
900957

@@ -934,6 +991,8 @@ require('lazy').setup({
934991
return '%2l:%-2v'
935992
end
936993

994+
require('mini.pairs').setup()
995+
937996
-- ... and there is more!
938997
-- Check out: https://github.com/echasnovski/mini.nvim
939998
end,
@@ -964,6 +1023,34 @@ require('lazy').setup({
9641023
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
9651024
},
9661025

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+
},
9671054
-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
9681055
-- init.lua. If you want these files, they are in the repository, so you can just download them and
9691056
-- place them in the correct locations.

0 commit comments

Comments
 (0)