@@ -110,6 +110,10 @@ vim.opt.mouse = 'a'
110110-- Don't show the mode, since it's already in the status line
111111vim .opt .showmode = false
112112
113+ -- Expand tabs
114+ vim .opt .expandtab = true
115+ vim .opt .softtabstop = 2
116+
113117-- Sync clipboard between OS and Neovim.
114118-- Schedule the setting after `UiEnter` because it can increase startup-time.
115119-- Remove this option if you want your OS clipboard to remain independent.
@@ -164,14 +168,11 @@ vim.opt.scrolloff = 10
164168-- See `:help hlsearch`
165169vim .keymap .set (' n' , ' <Esc>' , ' <cmd>nohlsearch<CR>' )
166170
167- -- Directory path view
168- vim .keymap .set (' n' , ' <leader>pv' , vim .cmd .Ex , { desc = ' Show current [p]ath [v]iew' })
169-
170171-- Diagnostic keymaps
171172-- In same window
172173vim .keymap .set (' n' , ' <leader>q' , vim .diagnostic .setloclist , { desc = ' Open diagnostic [Q]uickfix list' })
173174-- Global
174- vim .keymap .set (' n' ,' <C-q>' , vim .diagnostic .setqflist , { desc = ' Open global diagnostic [Q]uickfix list' })
175+ -- vim.keymap.set('n','<C-q>', vim.diagnostic.setqflist, { desc = 'Open global diagnostic [Q]uickfix list' })
175176
176177-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
177178-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
@@ -182,10 +183,10 @@ vim.keymap.set('n','<C-q>', vim.diagnostic.setqflist, { desc = 'Open global diag
182183vim .keymap .set (' t' , ' <Esc><Esc>' , ' <C-\\ ><C-n>' , { desc = ' Exit terminal mode' })
183184
184185-- TIP: Disable arrow keys in normal mode
185- -- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
186- -- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
187- -- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
188- -- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
186+ vim .keymap .set (' n' , ' <left>' , ' <cmd>echo "Use h to move!!"<CR>' )
187+ vim .keymap .set (' n' , ' <right>' , ' <cmd>echo "Use l to move!!"<CR>' )
188+ vim .keymap .set (' n' , ' <up>' , ' <cmd>echo "Use k to move!!"<CR>' )
189+ vim .keymap .set (' n' , ' <down>' , ' <cmd>echo "Use j to move!!"<CR>' )
189190
190191-- Keybinds to make split navigation easier.
191192-- Use CTRL+<hjkl> to switch between windows
@@ -203,6 +204,15 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
203204vim .keymap .set (' n' , ' <M-j>' , ' <cmd>cnext<CR>' )
204205vim .keymap .set (' n' , ' <M-k>' , ' <cmd>cprev<CR>' )
205206
207+ -- Yank buffer absolute path
208+ vim .keymap .set (' n' , ' <leader>yp' , function ()
209+ vim .fn .setreg (' +' , vim .fn .expand (' %' ))
210+ end , { desc = ' Yank relative path of current buffer' })
211+
212+ vim .keymap .set (' n' , ' <leader>yP' , function ()
213+ vim .fn .setreg (' +' , vim .fn .expand (' %:p' ))
214+ end , { desc = ' Yank absolute path to buffer' })
215+
206216-- [[ Basic Autocommands ]]
207217-- See `:help lua-guide-autocommands`
208218
@@ -242,9 +252,9 @@ vim.opt.rtp:prepend(lazypath)
242252-- NOTE: Here is where you install your plugins.
243253require (' lazy' ).setup ({
244254 -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
245- -- { -- Detect tabstop and shiftwidth automatically
246- -- 'tpope/vim-sleuth',
247- -- },
255+ { -- Detect tabstop and shiftwidth automatically
256+ ' tpope/vim-sleuth' ,
257+ },
248258
249259 -- NOTE: Plugins can also be added by using a table,
250260 -- with the first argument being the link and the following
@@ -419,6 +429,13 @@ require('lazy').setup({
419429 vim .keymap .set (' n' , ' <leader>sh' , builtin .help_tags , { desc = ' [S]earch [H]elp' })
420430 vim .keymap .set (' n' , ' <leader>sk' , builtin .keymaps , { desc = ' [S]earch [K]eymaps' })
421431 vim .keymap .set (' n' , ' <leader>sf' , builtin .find_files , { desc = ' [S]earch [F]iles' })
432+ vim .keymap .set (' n' , ' <leader>sF' , function ()
433+ builtin .find_files ({
434+ hidden = true ,
435+ no_ignore = true ,
436+ no_ignore_parent = true ,
437+ })
438+ end , { desc = ' [S]earch [F]iles, include ignored files' })
422439 vim .keymap .set (' n' , ' <leader>ss' , builtin .builtin , { desc = ' [S]earch [S]elect Telescope' })
423440 vim .keymap .set (' n' , ' <leader>sw' , builtin .grep_string , { desc = ' [S]earch current [W]ord' })
424441 vim .keymap .set (' n' , ' <leader>sg' , builtin .live_grep , { desc = ' [S]earch by [G]rep' })
@@ -631,7 +648,7 @@ require('lazy').setup({
631648 -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
632649 local servers = {
633650 -- clangd = {},
634- -- gopls = {},
651+ gopls = {},
635652 -- pyright = {},
636653 -- rust_analyzer = {},
637654 -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
@@ -643,6 +660,10 @@ require('lazy').setup({
643660 -- ts_ls = {},
644661 --
645662
663+ -- golangci_lint_ls = {
664+ -- cmd = vim.fn.expand(os.getenv("HOME") .. "/go/bin/golangci-lint-langserver"),
665+ -- },
666+
646667 lua_ls = {
647668 -- cmd = {...},
648669 -- filetypes = { ...},
@@ -657,6 +678,67 @@ require('lazy').setup({
657678 },
658679 },
659680 },
681+
682+ phpactor = {
683+ cmd = { " phpactor" , " language-server" },
684+ },
685+
686+ rust_analyzer = {
687+ -- rustup component add rust-analyzer
688+ },
689+
690+ tailwindcss = {
691+ -- npm install -g @tailwindcss/language-server
692+ tailwindCSS = {
693+ classAttributes = { " class" , " className" , " class:list" , " classList" , " ngClass" },
694+ includeLanguages = {
695+ eelixir = " html-eex" ,
696+ eruby = " erb" ,
697+ htmlangular = " html" ,
698+ templ = " html" ,
699+ volar = " vue" ,
700+ },
701+ lint = {
702+ cssConflict = " warning" ,
703+ invalidApply = " error" ,
704+ invalidConfigPath = " error" ,
705+ invalidScreen = " error" ,
706+ invalidTailwindDirective = " error" ,
707+ invalidVariant = " error" ,
708+ recommendedVariantOrder = " warning"
709+ },
710+ validate = true
711+ }
712+ },
713+
714+ ts_ls = {
715+ init_options = {
716+ plugins = {
717+ {
718+ name = " @vue/typescript-plugin" ,
719+ -- npm install -g @vue/typescript-plugin typescript-language-server typescript
720+ location = vim .fn .expand (os.getenv (" NVM_BIN" ) .. " /../lib/node_modules/@vue/typescript-plugin" ),
721+ languages = {" javascript" , " typescript" , " vue" },
722+ },
723+ },
724+ },
725+ filetypes = {
726+ " javascript" ,
727+ " typescript" ,
728+ " vue" ,
729+ },
730+ },
731+
732+ volar = {
733+ -- npm install -g @vue/language-server
734+ filetypes = {' typescript' , ' javascript' , ' javascriptreact' , ' typescriptreact' , ' vue' , ' json' },
735+ init_options = {
736+ typescript = {
737+ tsdk = vim .fn .expand (os.getenv (" NVM_BIN" ) .. " /../lib/node_modules/typescript/lib" )
738+ }
739+ }
740+ }
741+
660742 }
661743
662744 -- Ensure the servers and tools above are installed
@@ -921,7 +1003,7 @@ require('lazy').setup({
9211003 main = ' nvim-treesitter.configs' , -- Sets main module to use for opts
9221004 -- [[ Configure Treesitter ]] See `:help nvim-treesitter`
9231005 opts = {
924- ensure_installed = {
1006+ ensure_installed = {
9251007 ' bash' , ' c' , ' css' , ' diff' , ' html' , ' javascript' , ' lua' , ' luadoc' ,
9261008 ' markdown' , ' markdown_inline' , ' query' , ' scss' , ' typescript' , ' vim' ,
9271009 ' vimdoc' , ' vue'
@@ -943,6 +1025,26 @@ require('lazy').setup({
9431025 -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
9441026 -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
9451027 -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
1028+ config = function (plug , config )
1029+ -- https://github.com/EmranMR/tree-sitter-blade/discussions/19
1030+ local parser_config = require " nvim-treesitter.parsers" .get_parser_configs ()
1031+ parser_config .blade = {
1032+ install_info = {
1033+ url = " https://github.com/EmranMR/tree-sitter-blade" ,
1034+ files = {" src/parser.c" },
1035+ branch = " main" ,
1036+ },
1037+ filetype = " blade"
1038+ }
1039+
1040+ vim .filetype .add ({
1041+ pattern = {
1042+ [' .*%.blade%.php' ] = ' blade' ,
1043+ }
1044+ })
1045+
1046+ require (plug .main ).setup (config );
1047+ end ,
9461048 },
9471049
9481050 -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
@@ -959,7 +1061,7 @@ require('lazy').setup({
9591061 -- require 'kickstart.plugins.lint',
9601062 -- require 'kickstart.plugins.autopairs',
9611063 -- require 'kickstart.plugins.neo-tree',
962- -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
1064+ require ' kickstart.plugins.gitsigns' , -- adds gitsigns recommend keymaps
9631065
9641066 -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
9651067 -- This is the easiest way to modularize your config.
@@ -993,8 +1095,5 @@ require('lazy').setup({
9931095 },
9941096})
9951097
996- vim .o .expandtab = true
997- vim .o .shiftwidth = 4
998-
9991098-- The line beneath this is called `modeline`. See `:help modeline`
10001099-- vim: ts=2 sts=2 sw=2 et
0 commit comments