diff --git a/init.lua b/init.lua index d5ae6dc9b2a..245c6edc253 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.o` @@ -189,6 +189,15 @@ vim.diagnostic.config { vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) +-- Insert PHP doc block comment +vim.keymap.set('n', 'cd', function() + local line = vim.api.nvim_get_current_line() + if line:match '^%s*$' then -- if line is empty or whitespace + vim.api.nvim_put({ '/**', ' * ', ' */' }, 'l', true, true) + vim.api.nvim_command 'normal! k$' + end +end, { desc = '[C]omment [D]oc block' }) + -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier -- for people to discover. Otherwise, you normally need to press , which -- is not what someone will guess without a bit more experience. @@ -409,6 +418,7 @@ require('lazy').setup({ vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', 'sc', builtin.commands, { desc = '[S]earch [C]ommands' }) vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + vim.keymap.set('n', 'cp', ':let @+=expand("%:p")') -- This runs on LSP attach per buffer (see main LSP attach function in 'neovim/nvim-lspconfig' config for more info, -- it is better explained there). This allows easily switching between pickers if you prefer using something else! @@ -472,6 +482,17 @@ require('lazy').setup({ end, }, + -- Flutter tools + { + 'nvim-flutter/flutter-tools.nvim', + lazy = false, + dependencies = { + 'nvim-lua/plenary.nvim', + 'stevearc/dressing.nvim', -- optional for vim.ui.select + }, + config = true, + }, + -- LSP Plugins { -- Main LSP Configuration @@ -830,6 +851,7 @@ require('lazy').setup({ -- - sd' - [S]urround [D]elete [']quotes -- - sr)' - [S]urround [R]eplace [)] ['] require('mini.surround').setup() + require('mini.comment').setup() -- Simple and easy statusline. -- You could remove this setup call if you don't like it, @@ -873,7 +895,7 @@ require('lazy').setup({ -- require 'kickstart.plugins.debug', -- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps