Skip to content

Commit 667d50c

Browse files
committed
Merge branch 'ser5' into kiss
2 parents bf43a9c + 1b2dbac commit 667d50c

File tree

1 file changed

+92
-31
lines changed

1 file changed

+92
-31
lines changed

init.lua

Lines changed: 92 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
--[[
2-
If you don't know anything about Lua, I recommend taking some time to read through
3-
a guide. One possible example which will only take 10-15 minutes:
4-
- https://learnxinyminutes.com/docs/lua/
5-
6-
After understanding a bit more about Lua, you can use `:help lua-guide` as a
7-
reference for how Neovim integrates Lua.
8-
- :help lua-guide
9-
- (or HTML version): https://neovim.io/doc/user/lua-guide.html
10-
2+
kickstart nvim
113
Run AND READ `:help`.
124
This will open up a help window with some basic information
135
about reading, navigating and searching the builtin help documentation.
@@ -29,6 +21,9 @@
2921
for when you are first encountering a few different constructs in your Neovim config.
3022
3123
If you experience any errors while trying to install kickstart, run `:checkhealth` for more info.
24+
25+
I hope you enjoy your Neovim journey,
26+
- TJ
3227
--]]
3328

3429
-- Set <space> as the leader key
@@ -46,7 +41,6 @@ vim.g.have_nerd_font = true
4641
-- For more options, you can see `:help option-list`
4742

4843
vim.opt.number = true
49-
5044
vim.opt.relativenumber = true
5145

5246
-- Enable mouse mode, can be useful for resizing splits for example!
@@ -55,6 +49,14 @@ vim.opt.mouse = 'a'
5549
-- Don't show the mode, since it's already in the status line
5650
vim.opt.showmode = false
5751

52+
-- Sync clipboard between OS and Neovim.
53+
-- Schedule the setting after `UiEnter` because it can increase startup-time.
54+
-- Remove this option if you want your OS clipboard to remain independent.
55+
-- See `:help 'clipboard'`
56+
vim.schedule(function()
57+
-- vim.opt.clipboard = 'unnamedplus'
58+
end)
59+
5860
-- Enable break indent
5961
vim.opt.breakindent = true
6062

@@ -117,10 +119,10 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
117119
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
118120

119121
-- TIP: Disable arrow keys in normal mode
120-
-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
121-
-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
122-
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
123-
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
122+
vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
123+
vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
124+
vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
125+
vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
124126

125127
-- Keybinds to make split navigation easier.
126128
-- Use CTRL+<hjkl> to switch between windows
@@ -600,18 +602,17 @@ require('lazy').setup({
600602
-- - settings (table): Override the default settings passed when initializing the server.
601603
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
602604
local servers = {
603-
-- clangd = {},
604-
-- gopls = {},
605+
clangd = {},
606+
gopls = {},
605607
pyright = {},
606-
-- rust_analyzer = {},
608+
rust_analyzer = {},
609+
ts_ls = {},
607610
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
608611
--
609612
-- Some languages (like typescript) have entire language plugins that can be useful:
610613
-- https://github.com/pmizio/typescript-tools.nvim
611614
--
612615
-- But for many setups, the LSP (`ts_ls`) will work just fine
613-
ts_ls = {},
614-
--
615616

616617
lua_ls = {
617618
-- cmd = { ... },
@@ -623,10 +624,24 @@ require('lazy').setup({
623624
callSnippet = 'Replace',
624625
},
625626
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
627+
diagnostics = {
628+
globals = {
629+
'vim',
630+
'love',
631+
},
632+
},
626633
-- diagnostics = { disable = { 'missing-fields' } },
634+
workspace = {
635+
library = {
636+
[vim.fn.expand '$VIMRUNTIME/lua'] = true,
637+
[vim.fn.expand '$VIMRUNTIME/lua/vim/lsp'] = true,
638+
['${3rd}/love2d/library'] = true, -- Add Love2D library
639+
},
640+
},
627641
},
628642
},
629643
},
644+
intelephense = {},
630645
}
631646

632647
-- Ensure the servers and tools above are installed
@@ -698,10 +713,10 @@ require('lazy').setup({
698713
formatters_by_ft = {
699714
lua = { 'stylua' },
700715
-- Conform can also run multiple formatters sequentially
701-
-- python = { "isort", "black" },
716+
python = { 'isort', 'black' },
717+
javascript = { 'prettierd', 'prettier', stop_after_first = true },
702718
--
703719
-- You can use 'stop_after_first' to run the first available formatter from the list
704-
-- javascript = { "prettierd", "prettier", stop_after_first = true },
705720
},
706721
},
707722
},
@@ -819,7 +834,6 @@ require('lazy').setup({
819834
comments = { italic = false }, -- Disable italics in comments
820835
},
821836
}
822-
823837
vim.cmd.colorscheme 'tokyonight-night'
824838
end,
825839
},
@@ -909,12 +923,12 @@ require('lazy').setup({
909923
-- Here are some example plugins that I've included in the Kickstart repository.
910924
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
911925
--
912-
-- require 'kickstart.plugins.debug',
913-
-- require 'kickstart.plugins.indent_line',
914-
-- require 'kickstart.plugins.lint',
915-
-- require 'kickstart.plugins.autopairs',
916-
-- require 'kickstart.plugins.neo-tree',
917-
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
926+
--require 'kickstart.plugins.debug',
927+
require 'kickstart.plugins.indent_line',
928+
require 'kickstart.plugins.lint',
929+
require 'kickstart.plugins.autopairs',
930+
require 'kickstart.plugins.neo-tree',
931+
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
918932

919933
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
920934
-- This is the easiest way to modularize your config.
@@ -926,6 +940,31 @@ require('lazy').setup({
926940
-- Or use telescope!
927941
-- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
928942
-- you can continue same window with `<space>sr` which resumes last telescope search
943+
944+
{
945+
'stevearc/oil.nvim', ---@module 'oil'
946+
---@type oil.SetupOpts
947+
opts = {},
948+
-- Optional dependencies
949+
dependencies = { { 'echasnovski/mini.icons', opts = {} } },
950+
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
951+
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
952+
lazy = false,
953+
},
954+
{
955+
'ray-x/go.nvim',
956+
dependencies = { -- optional packages
957+
'ray-x/guihua.lua',
958+
'neovim/nvim-lspconfig',
959+
'nvim-treesitter/nvim-treesitter',
960+
},
961+
config = function()
962+
require('go').setup()
963+
end,
964+
event = { 'CmdlineEnter' },
965+
ft = { 'go', 'gomod' },
966+
build = ':lua require("go.install").update_all_sync()', -- if you need to install/update all binaries
967+
},
929968
}, {
930969
ui = {
931970
-- If you are using a Nerd Font: set icons to an empty table which will use the
@@ -948,7 +987,29 @@ require('lazy').setup({
948987
},
949988
})
950989

951-
require('oil').setup()
990+
991+
require('oil').setup {
992+
default_file_explorer = true,
993+
columns = {
994+
'icon',
995+
-- 'permissions',
996+
'size',
997+
-- 'mtime',
998+
},
999+
}
9521000
vim.keymap.set('n', '-', '<CMD>Oil<CR>', { desc = 'Open parent directory' })
953-
-- The line beneath this is called `modeline`. See `:help modeline`
954-
-- vim: ts=2 sts=2 sw=2 et
1001+
1002+
vim.opt['tabstop'] = 4
1003+
vim.opt['softtabstop'] = 4
1004+
vim.opt['shiftwidth'] = 4
1005+
vim.opt['expandtab'] = true
1006+
1007+
vim.api.nvim_create_autocmd('BufEnter', {
1008+
pattern = '*.gd',
1009+
callback = function()
1010+
vim.bo.tabstop = 4
1011+
vim.bo.softtabstop = 4
1012+
vim.bo.shiftwidth = 4
1013+
vim.bo.expandtab = true
1014+
end,
1015+
})

0 commit comments

Comments
 (0)