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
@@ -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
@@ -699,9 +714,8 @@ require('lazy').setup({
699
714
lua = { ' stylua' },
700
715
-- Conform can also run multiple formatters sequentially
701
716
python = { ' isort' , ' black' },
702
- --
717
+ javascript = { ' prettierd ' , ' prettier ' , stop_after_first = true },
703
718
-- You can use 'stop_after_first' to run the first available formatter from the list
704
- -- javascript = { "prettierd", "prettier", stop_after_first = true },
705
719
},
706
720
},
707
721
},
@@ -819,7 +833,6 @@ require('lazy').setup({
819
833
comments = { italic = false }, -- Disable italics in comments
820
834
},
821
835
}
822
-
823
836
vim .cmd .colorscheme ' tokyonight-night'
824
837
end ,
825
838
},
@@ -909,12 +922,12 @@ require('lazy').setup({
909
922
-- Here are some example plugins that I've included in the Kickstart repository.
910
923
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
911
924
--
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
925
+ -- require 'kickstart.plugins.debug',
926
+ require ' kickstart.plugins.indent_line' ,
927
+ require ' kickstart.plugins.lint' ,
928
+ require ' kickstart.plugins.autopairs' ,
929
+ require ' kickstart.plugins.neo-tree' ,
930
+ require ' kickstart.plugins.gitsigns' , -- adds gitsigns recommend keymaps
918
931
919
932
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
920
933
-- This is the easiest way to modularize your config.
@@ -926,6 +939,31 @@ require('lazy').setup({
926
939
-- Or use telescope!
927
940
-- In normal mode type `<space>sh` then write `lazy.nvim-plugin`
928
941
-- you can continue same window with `<space>sr` which resumes last telescope search
942
+
943
+ {
944
+ ' stevearc/oil.nvim' , --- @module ' oil'
945
+ --- @type oil.SetupOpts
946
+ opts = {},
947
+ -- Optional dependencies
948
+ dependencies = { { ' echasnovski/mini.icons' , opts = {} } },
949
+ -- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
950
+ -- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
951
+ lazy = false ,
952
+ },
953
+ {
954
+ ' ray-x/go.nvim' ,
955
+ dependencies = { -- optional packages
956
+ ' ray-x/guihua.lua' ,
957
+ ' neovim/nvim-lspconfig' ,
958
+ ' nvim-treesitter/nvim-treesitter' ,
959
+ },
960
+ config = function ()
961
+ require (' go' ).setup ()
962
+ end ,
963
+ event = { ' CmdlineEnter' },
964
+ ft = { ' go' , ' gomod' },
965
+ build = ' :lua require("go.install").update_all_sync()' , -- if you need to install/update all binaries
966
+ },
929
967
}, {
930
968
ui = {
931
969
-- If you are using a Nerd Font: set icons to an empty table which will use the
@@ -948,7 +986,29 @@ require('lazy').setup({
948
986
},
949
987
})
950
988
951
- require (' oil' ).setup ()
989
+
990
+ require (' oil' ).setup {
991
+ default_file_explorer = true ,
992
+ columns = {
993
+ ' icon' ,
994
+ -- 'permissions',
995
+ ' size' ,
996
+ -- 'mtime',
997
+ },
998
+ }
952
999
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
1000
+
1001
+ vim .opt [' tabstop' ] = 4
1002
+ vim .opt [' softtabstop' ] = 4
1003
+ vim .opt [' shiftwidth' ] = 4
1004
+ vim .opt [' expandtab' ] = true
1005
+
1006
+ vim .api .nvim_create_autocmd (' BufEnter' , {
1007
+ pattern = ' *.gd' ,
1008
+ callback = function ()
1009
+ vim .bo .tabstop = 4
1010
+ vim .bo .softtabstop = 4
1011
+ vim .bo .shiftwidth = 4
1012
+ vim .bo .expandtab = true
1013
+ end ,
1014
+ })
0 commit comments