@@ -83,15 +83,27 @@ I hope you enjoy your Neovim journey,
8383
8484P.S. You can delete this when you're done too. It's your config now! :)
8585--]]
86-
87- -- Set <space> as the leader key
86+ -- Configure netrw to open on the right side
87+ vim .g .netrw_banner = 0 -- Hide the banner
88+ vim .g .netrw_liststyle = 3 -- Use a tree-like view
89+ vim .g .netrw_winsize = 20 -- Set explorer width
90+ vim .g .netrw_altv = 1 -- Open in right vertical split
91+ vim .opt .tabstop = 4
92+ vim .opt .shiftwidth = 4
93+ vim .opt .expandtab = true
94+ vim .opt .softtabstop = 4
95+ vim .opt .spell = true -- Enable spell checking
96+ vim .opt .spelllang = ' en' -- Set spell check language to English
97+ vim .opt .foldmethod = ' indent' -- Fold based on indentation
98+ vim .opt .foldlevel = 99 -- Open all folds by default
99+ vim .opt .foldenable = true -- Enable folding-- Set <space> as the leader key
88100-- See `:help mapleader`
89101-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
90102vim .g .mapleader = ' '
91103vim .g .maplocalleader = ' '
92104
93105-- Set to true if you have a Nerd Font installed and selected in the terminal
94- vim .g .have_nerd_font = false
106+ vim .g .have_nerd_font = true
95107
96108-- [[ Setting options ]]
97109-- See `:help vim.opt`
@@ -166,6 +178,11 @@ vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
166178-- Diagnostic keymaps
167179vim .keymap .set (' n' , ' <leader>q' , vim .diagnostic .setloclist , { desc = ' Open diagnostic [Q]uickfix list' })
168180
181+ -- Map <leader>p to open netrw in a vertical split
182+ vim .keymap .set (' n' , ' <leader>p' , function ()
183+ vim .cmd ' vertical rightbelow Lexplore 25' -- Open on the right
184+ end , { desc = ' Open file explorer [P]' })
185+
169186-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
170187-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
171188-- is not what someone will guess without a bit more experience.
@@ -245,12 +262,16 @@ require('lazy').setup({
245262 { -- Adds git related signs to the gutter, as well as utilities for managing changes
246263 ' lewis6991/gitsigns.nvim' ,
247264 opts = {
265+ current_line_blame = true , -- Toggle with `:Gitsigns toggle_current_line_blame`
266+ current_line_blame_opts = {
267+ virt_text_pos = ' right_align' , -- 'eol' | 'overlay' | 'right_align'
268+ },
248269 signs = {
249270 add = { text = ' +' },
250- change = { text = ' ~ ' },
251- delete = { text = ' _ ' },
271+ change = { text = ' Ͼ ' },
272+ delete = { text = ' ' },
252273 topdelete = { text = ' ‾' },
253- changedelete = { text = ' ~ ' },
274+ changedelete = { text = ' Ͼ ' },
254275 },
255276 },
256277 },
@@ -590,14 +611,14 @@ require('lazy').setup({
590611 })
591612
592613 -- Change diagnostic symbols in the sign column (gutter)
593- -- if vim.g.have_nerd_font then
594- -- local signs = { ERROR = '', WARN = '', INFO = '', HINT = '' }
595- -- local diagnostic_signs = {}
596- -- for type, icon in pairs(signs) do
597- -- diagnostic_signs[vim.diagnostic.severity[type]] = icon
598- -- end
599- -- vim.diagnostic.config { signs = { text = diagnostic_signs } }
600- -- end
614+ if vim .g .have_nerd_font then
615+ local signs = { ERROR = ' ' , WARN = ' ' , INFO = ' ' , HINT = ' ' }
616+ local diagnostic_signs = {}
617+ for type , icon in pairs (signs ) do
618+ diagnostic_signs [vim .diagnostic .severity [type ]] = icon
619+ end
620+ vim .diagnostic .config { signs = { text = diagnostic_signs } }
621+ end
601622
602623 -- LSP servers and clients are able to communicate to each other what features they support.
603624 -- By default, Neovim doesn't support everything that is in the LSP specification.
@@ -618,7 +639,7 @@ require('lazy').setup({
618639 local servers = {
619640 -- clangd = {},
620641 -- gopls = {},
621- -- pyright = {},
642+ pyright = {},
622643 -- rust_analyzer = {},
623644 -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
624645 --
@@ -639,7 +660,7 @@ require('lazy').setup({
639660 callSnippet = ' Replace' ,
640661 },
641662 -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
642- -- diagnostics = { disable = { 'missing-fields' } },
663+ diagnostics = { disable = { ' missing-fields' } },
643664 },
644665 },
645666 },
@@ -678,7 +699,32 @@ require('lazy').setup({
678699 }
679700 end ,
680701 },
681-
702+ {
703+ ' pmizio/typescript-tools.nvim' ,
704+ dependencies = { ' nvim-lua/plenary.nvim' , ' neovim/nvim-lspconfig' },
705+ opts = {
706+ settings = {
707+ tsserver_plugins = {
708+ -- Add support for styled-components, remove if not needed
709+ ' @styled/typescript-styled-plugin' ,
710+ },
711+ -- Ensures proper Next.js support
712+ tsserver_file_preferences = {
713+ includeInlayParameterNameHints = ' all' ,
714+ includeInlayVariableTypeHints = true ,
715+ },
716+ tsserver_format_options = {
717+ allowRenameOfImportPath = true ,
718+ },
719+ complete_function_calls = true , -- Auto-complete function arguments
720+ },
721+ },
722+ config = function ()
723+ require (' typescript-tools' ).setup {
724+ capabilities = require (' cmp_nvim_lsp' ).default_capabilities (),
725+ }
726+ end ,
727+ },
682728 { -- Autoformat
683729 ' stevearc/conform.nvim' ,
684730 event = { ' BufWritePre' },
@@ -714,10 +760,10 @@ require('lazy').setup({
714760 formatters_by_ft = {
715761 lua = { ' stylua' },
716762 -- Conform can also run multiple formatters sequentially
717- -- python = { " isort", " black" },
763+ python = { ' isort' , ' black' },
718764 --
719765 -- You can use 'stop_after_first' to run the first available formatter from the list
720- -- javascript = { " prettierd", " prettier" , stop_after_first = true },
766+ javascript = { ' prettierd' , ' prettier' , stop_after_first = true },
721767 },
722768 },
723769 },
@@ -742,12 +788,12 @@ require('lazy').setup({
742788 -- `friendly-snippets` contains a variety of premade snippets.
743789 -- See the README about individual language/framework/plugin snippets:
744790 -- https://github.com/rafamadriz/friendly-snippets
745- -- {
746- -- 'rafamadriz/friendly-snippets',
747- -- config = function()
748- -- require('luasnip.loaders.from_vscode').lazy_load()
749- -- end,
750- -- },
791+ {
792+ ' rafamadriz/friendly-snippets' ,
793+ config = function ()
794+ require (' luasnip.loaders.from_vscode' ).lazy_load { paths = { vim . fn . stdpath ' config ' .. ' /snippets ' } }
795+ end ,
796+ },
751797 },
752798 },
753799 ' saadparwaiz1/cmp_luasnip' ,
@@ -789,7 +835,7 @@ require('lazy').setup({
789835 -- Accept ([y]es) the completion.
790836 -- This will auto-import if your LSP supports it.
791837 -- This will expand snippets if the LSP sent a snippet.
792- [' <C-y >' ] = cmp .mapping .confirm { select = true },
838+ [' <Enter >' ] = cmp .mapping .confirm { select = true },
793839
794840 -- If you prefer more traditional completion keymaps,
795841 -- you can uncomment the following lines
@@ -900,9 +946,9 @@ require('lazy').setup({
900946 ' nvim-treesitter/nvim-treesitter' ,
901947 build = ' :TSUpdate' ,
902948 main = ' nvim-treesitter.configs' , -- Sets main module to use for opts
903- -- [[ Configure Treesitter ]] See `:help nvim-treesitter`
949+ -- [[ Configure Treesitter ]] See `:help nvim-treesitter`
904950 opts = {
905- ensure_installed = { ' bash' , ' c' , ' diff' , ' html' , ' lua' , ' luadoc' , ' markdown' , ' markdown_inline' , ' query' , ' vim' , ' vimdoc' },
951+ ensure_installed = { ' bash' , ' c' , ' diff' , ' html' , ' javascript ' , ' typescript ' , ' lua' , ' luadoc' , ' markdown' , ' markdown_inline' , ' query' , ' vim' , ' vimdoc' },
906952 -- Autoinstall languages that are not installed
907953 auto_install = true ,
908954 highlight = {
@@ -921,6 +967,19 @@ require('lazy').setup({
921967 -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
922968 -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
923969 },
970+ {
971+ ' prichrd/netrw.nvim' ,
972+ opts = {},
973+ config = function ()
974+ require (' netrw' ).setup {
975+
976+ mappings = {
977+ -- String mappings are executed as vim commands
978+ [' <Leader>p' ] = ' :Explore<CR>' ,
979+ },
980+ }
981+ end ,
982+ },
924983
925984 -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
926985 -- init.lua. If you want these files, they are in the repository, so you can just download them and
@@ -932,11 +991,11 @@ require('lazy').setup({
932991 -- Uncomment any of the lines below to enable them (you will need to restart nvim).
933992 --
934993 -- require 'kickstart.plugins.debug',
935- -- require 'kickstart.plugins.indent_line',
936- -- require 'kickstart.plugins.lint',
994+ require ' kickstart.plugins.indent_line' ,
995+ require ' kickstart.plugins.lint' ,
937996 -- require 'kickstart.plugins.autopairs',
938- -- require 'kickstart.plugins.neo-tree',
939- -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
997+ require ' kickstart.plugins.neo-tree' ,
998+ require ' kickstart.plugins.gitsigns' , -- adds gitsigns recommend keymaps
940999
9411000 -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
9421001 -- This is the easiest way to modularize your config.
0 commit comments