diff --git a/init.lua b/init.lua index db55a9e8..856bd006 100644 --- a/init.lua +++ b/init.lua @@ -102,7 +102,7 @@ vim.g.have_nerd_font = false vim.opt.number = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! --- vim.opt.relativenumber = true +vim.opt.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.opt.mouse = 'a' @@ -272,7 +272,6 @@ require('lazy').setup({ -- Then, because we use the `config` key, the configuration only runs -- after the plugin has been loaded: -- config = function() ... end - { -- Useful plugin to show you pending keybinds. 'folke/which-key.nvim', event = 'VimEnter', -- Sets the loading event to 'VimEnter' @@ -323,7 +322,7 @@ require('lazy').setup({ }, config = function() -- Telescope is a fuzzy finder that comes with a lot of different things that - -- it can fuzzy find! It's more than just a "file finder", it can search + -- it can fuzzy find! It's more than just a --[[ "file finder" ]], it can search -- many different aspects of Neovim, your workspace, LSP, and more! -- -- The easiest way to use Telescope, is to start by doing something like: @@ -541,14 +540,14 @@ require('lazy').setup({ -- clangd = {}, -- gopls = {}, -- pyright = {}, - -- rust_analyzer = {}, + rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- -- Some languages (like typescript) have entire language plugins that can be useful: -- https://github.com/pmizio/typescript-tools.nvim -- -- But for many setups, the LSP (`tsserver`) will work just fine - -- tsserver = {}, + tsserver = {}, -- lua_ls = { @@ -613,13 +612,24 @@ require('lazy').setup({ } end, formatters_by_ft = { - lua = { 'stylua' }, -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- -- You can use a sub-list to tell conform to run *until* a formatter -- is found. - -- javascript = { { "prettierd", "prettier" } }, + javascript = { 'prettier' }, + typescript = { 'prettier' }, + javascriptreact = { 'prettier' }, + typescriptreact = { 'prettier' }, + svelte = { 'prettier' }, + css = { 'prettier' }, + html = { 'prettier' }, + json = { 'prettier' }, + yaml = { 'prettier' }, + markdown = { 'prettier' }, + graphql = { 'prettier' }, + lua = { 'stylua' }, + rust = { 'rustfmt' }, }, }, }, @@ -724,6 +734,7 @@ require('lazy').setup({ { name = 'nvim_lsp' }, { name = 'luasnip' }, { name = 'path' }, + { name = 'tsserver' }, }, } end, diff --git a/lua/custom/mappings.lua b/lua/custom/mappings.lua new file mode 100644 index 00000000..ea64d673 --- /dev/null +++ b/lua/custom/mappings.lua @@ -0,0 +1,6 @@ +local map = vim.keymap.set + +map({ 'n' }, 'cw', ':%s/\\<\\>//gI', { desc = '[C]ut [W]orld' }) +map({ 'n' }, 'x', 'bd', { desc = 'Close buffer' }) +map('n', 'n', 'nzzzv') +map('n', 'N', 'Nzzzv')