1
1
--[[
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
11
3
Run AND READ `:help`.
12
4
This will open up a help window with some basic information
13
5
about reading, navigating and searching the builtin help documentation.
29
21
for when you are first encountering a few different constructs in your Neovim config.
30
22
31
23
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
32
27
--]]
33
28
34
29
-- Set <space> as the leader key
@@ -46,7 +41,6 @@ vim.g.have_nerd_font = true
46
41
-- For more options, you can see `:help option-list`
47
42
48
43
vim .opt .number = true
49
-
50
44
vim .opt .relativenumber = true
51
45
52
46
-- Enable mouse mode, can be useful for resizing splits for example!
@@ -55,6 +49,14 @@ vim.opt.mouse = 'a'
55
49
-- Don't show the mode, since it's already in the status line
56
50
vim .opt .showmode = false
57
51
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
+
58
60
-- Enable break indent
59
61
vim .opt .breakindent = true
60
62
@@ -117,10 +119,10 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
117
119
vim .keymap .set (' t' , ' <Esc><Esc>' , ' <C-\\ ><C-n>' , { desc = ' Exit terminal mode' })
118
120
119
121
-- 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>' )
124
126
125
127
-- Keybinds to make split navigation easier.
126
128
-- Use CTRL+<hjkl> to switch between windows
@@ -600,18 +602,17 @@ require('lazy').setup({
600
602
-- - settings (table): Override the default settings passed when initializing the server.
601
603
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
602
604
local servers = {
603
- -- clangd = {},
604
- -- gopls = {},
605
+ clangd = {},
606
+ gopls = {},
605
607
pyright = {},
606
- -- rust_analyzer = {},
608
+ rust_analyzer = {},
609
+ ts_ls = {},
607
610
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
608
611
--
609
612
-- Some languages (like typescript) have entire language plugins that can be useful:
610
613
-- https://github.com/pmizio/typescript-tools.nvim
611
614
--
612
615
-- But for many setups, the LSP (`ts_ls`) will work just fine
613
- ts_ls = {},
614
- --
615
616
616
617
lua_ls = {
617
618
-- cmd = { ... },
@@ -623,10 +624,24 @@ require('lazy').setup({
623
624
callSnippet = ' Replace' ,
624
625
},
625
626
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
627
+ diagnostics = {
628
+ globals = {
629
+ ' vim' ,
630
+ ' love' ,
631
+ },
632
+ },
626
633
-- 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
+ },
627
641
},
628
642
},
629
643
},
644
+ intelephense = {},
630
645
}
631
646
632
647
-- Ensure the servers and tools above are installed
@@ -698,10 +713,10 @@ require('lazy').setup({
698
713
formatters_by_ft = {
699
714
lua = { ' stylua' },
700
715
-- Conform can also run multiple formatters sequentially
701
- -- python = { "isort", "black" },
716
+ python = { ' isort' , ' black' },
717
+ javascript = { ' prettierd' , ' prettier' , stop_after_first = true },
702
718
--
703
719
-- You can use 'stop_after_first' to run the first available formatter from the list
704
- -- javascript = { "prettierd", "prettier", stop_after_first = true },
705
720
},
706
721
},
707
722
},
@@ -819,7 +834,6 @@ require('lazy').setup({
819
834
comments = { italic = false }, -- Disable italics in comments
820
835
},
821
836
}
822
-
823
837
vim .cmd .colorscheme ' tokyonight-night'
824
838
end ,
825
839
},
@@ -909,12 +923,12 @@ require('lazy').setup({
909
923
-- Here are some example plugins that I've included in the Kickstart repository.
910
924
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
911
925
--
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
918
932
919
933
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
920
934
-- This is the easiest way to modularize your config.
@@ -926,6 +940,31 @@ require('lazy').setup({
926
940
-- Or use telescope!
927
941
-- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
928
942
-- 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
+ },
929
968
}, {
930
969
ui = {
931
970
-- If you are using a Nerd Font: set icons to an empty table which will use the
@@ -948,7 +987,29 @@ require('lazy').setup({
948
987
},
949
988
})
950
989
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
+ }
952
1000
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