@@ -100,6 +100,7 @@ vim.g.have_nerd_font = false
100100
101101-- Make line numbers default
102102vim .opt .number = true
103+ vim .opt .relativenumber = true
103104-- You can also add relative line numbers, to help with jumping.
104105-- Experiment for yourself to see if you like it!
105106-- vim.opt.relativenumber = true
@@ -148,6 +149,10 @@ vim.opt.splitbelow = true
148149vim .opt .list = true
149150vim .opt .listchars = { tab = ' » ' , trail = ' ·' , nbsp = ' ␣' }
150151
152+ vim .opt .tabstop = 4 -- A TAB character looks like 4 spaces
153+ vim .opt .expandtab = true -- Pressing the TAB key will insert spaces instead of a TAB character
154+ vim .opt .softtabstop = 4 -- Number of spaces inserted instead of a TAB character
155+ vim .opt .shiftwidth = 4 -- Number of spaces inserted when indenting
151156-- Preview substitutions live, as you type!
152157vim .opt .inccommand = ' split'
153158
@@ -175,6 +180,8 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
175180-- or just use <C-\><C-n> to exit terminal mode
176181vim .keymap .set (' t' , ' <Esc><Esc>' , ' <C-\\ ><C-n>' , { desc = ' Exit terminal mode' })
177182
183+ vim .keymap .set (' n' , ' <leader><tab>' , ' <Cmd>Neotree toggle<CR>' )
184+
178185-- TIP: Disable arrow keys in normal mode
179186-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
180187-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
@@ -227,6 +234,7 @@ vim.opt.rtp:prepend(lazypath)
227234-- :Lazy update
228235--
229236-- NOTE: Here is where you install your plugins.
237+
230238require (' lazy' ).setup ({
231239 -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
232240 ' tpope/vim-sleuth' , -- Detect tabstop and shiftwidth automatically
@@ -267,9 +275,8 @@ require('lazy').setup({
267275 -- which loads which-key before all the UI elements are loaded. Events can be
268276 -- normal autocommands events (`:help autocmd-events`).
269277 --
270- -- Then, because we use the `config` key, the configuration only runs
271- -- after the plugin has been loaded:
272- -- config = function() ... end
278+ -- Then, because we use the `opts` key (recommended), the configuration runs
279+ -- after the plugin has been loaded as `require(MODULE).setup(opts)`.
273280
274281 { -- Useful plugin to show you pending keybinds.
275282 ' folke/which-key.nvim' ,
@@ -629,8 +636,8 @@ require('lazy').setup({
629636 --
630637
631638 lua_ls = {
632- -- cmd = {...},
633- -- filetypes = { ...},
639+ -- cmd = { ... },
640+ -- filetypes = { ... },
634641 -- capabilities = {},
635642 settings = {
636643 Lua = {
@@ -679,16 +686,16 @@ require('lazy').setup({
679686 ' stevearc/conform.nvim' ,
680687 event = { ' BufWritePre' },
681688 cmd = { ' ConformInfo' },
682- keys = {
683- {
684- ' <leader>f' ,
685- function ()
686- require (' conform' ).format { async = true , lsp_format = ' fallback' }
687- end ,
688- mode = ' ' ,
689- desc = ' [F]ormat buffer' ,
690- },
691- },
689+ -- keys = {
690+ -- {
691+ -- '<leader>f',
692+ -- function()
693+ -- require('conform').format { async = true, lsp_format = 'fallback' }
694+ -- end,
695+ -- mode = '',
696+ -- desc = '[F]ormat buffer',
697+ -- },
698+ -- },
692699 opts = {
693700 notify_on_error = false ,
694701 format_on_save = function (bufnr )
@@ -895,7 +902,8 @@ require('lazy').setup({
895902 { -- Highlight, edit, and navigate code
896903 ' nvim-treesitter/nvim-treesitter' ,
897904 build = ' :TSUpdate' ,
898- main = ' nvim-treesitter.configs' , -- Sets main module to use for opts
905+ main = ' nvim-treesitter.configs' , -- Sets main module to use for opts,
906+
899907 -- [[ Configure Treesitter ]] See `:help nvim-treesitter`
900908 opts = {
901909 ensure_installed = { ' bash' , ' c' , ' diff' , ' html' , ' lua' , ' luadoc' , ' markdown' , ' markdown_inline' , ' query' , ' vim' , ' vimdoc' },
@@ -909,6 +917,7 @@ require('lazy').setup({
909917 additional_vim_regex_highlighting = { ' ruby' },
910918 },
911919 indent = { enable = true , disable = { ' ruby' } },
920+ -- compilers = { 'gcc' }
912921 },
913922 -- There are additional nvim-treesitter modules that you can use to interact
914923 -- with nvim-treesitter. You should go explore a few and see what interests you:
@@ -931,7 +940,7 @@ require('lazy').setup({
931940 -- require 'kickstart.plugins.indent_line',
932941 -- require 'kickstart.plugins.lint',
933942 -- require 'kickstart.plugins.autopairs',
934- -- require 'kickstart.plugins.neo-tree',
943+ require ' kickstart.plugins.neo-tree' ,
935944 -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
936945
937946 -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
@@ -965,6 +974,23 @@ require('lazy').setup({
965974 },
966975 },
967976})
968-
977+ require (' nvim-treesitter.install' ).compilers = { ' clang' }
978+ local builtin = require ' telescope.builtin'
979+ vim .keymap .set (' n' , ' <leader>ff' , builtin .find_files , { desc = ' Telescope find files' })
980+ vim .keymap .set (' n' , ' <leader>fg' , builtin .live_grep , { desc = ' Telescope live grep' })
981+ vim .keymap .set (' n' , ' <leader>fb' , builtin .buffers , { desc = ' Telescope buffers' })
982+ vim .keymap .set (' n' , ' <leader>fh' , builtin .help_tags , { desc = ' Telescope help tags' })
983+ require (' telescope' ).setup {
984+ defaults = {
985+ file_ignore_patterns = {
986+ ' node_modules' ,
987+ ' Dependencies' ,
988+ ' CMakeFiles' ,
989+ ' cmake-build-debug' ,
990+ ' out/build' ,
991+ ' x64' ,
992+ },
993+ },
994+ }
969995-- The line beneath this is called `modeline`. See `:help modeline`
970996-- vim: ts=2 sts=2 sw=2 et
0 commit comments