-- vim: fdm=marker -- Enable modelines vim.o.modeline = true -- Enable hybrid line numbers vim.o.number = true vim.o.relativenumber = true -- Indent with two spaces by default vim.o.tabstop = 2 vim.o.shiftwidth = 2 vim.o.expandtab = true -- Enable smart indentation vim.o.smartindent = true -- Disable line wrapping vim.o.wrap = false -- Highlight the current line vim.o.cursorline = true -- Enable 24-bit RGB colors vim.o.termguicolors = true -- Enable syntax highlighting and filetype plugins vim.cmd('syntax enable') vim.cmd('filetype plugin indent on') -- Set leader key to space vim.g.mapleader = ' ' -- Set local leader to backslash vim.g.maplocalleader = '\\' -- Save/quit with vim.api.nvim_set_keymap('n', 'w', ':w', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', 'q', ':q', { noremap = true, silent = true }) -- Navigate between splts with vim.api.nvim_set_keymap('n', '', 'h', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '', 'j', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '', 'k', { noremap = true, silent = true }) vim.api.nvim_set_keymap('n', '', 'l', { noremap = true, silent = true }) -- Packages {{{ -- Bootstrap lazy.nvim local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then local lazyrepo = "https://github.com/folke/lazy.nvim.git" local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) if vim.v.shell_error ~= 0 then vim.api.nvim_echo({ { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, { out, "WarningMsg" }, { "\nPress any key to exit..." }, }, true, {}) vim.fn.getchar() os.exit(1) end end vim.opt.rtp:prepend(lazypath) -- Setup lazy.nvim require("lazy").setup({ spec = { { 'nvim-telescope/telescope.nvim', tag = '0.1.8', dependencies = { { 'nvim-lua/plenary.nvim' }, { 'BurntSushi/ripgrep'}, { 'nvim-tree/nvim-web-devicons' } }, config = function() require('telescope').setup({}) local builtin = require('telescope.builtin') vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'Telescope: Find files' }) vim.keymap.set('n', 'fg', builtin.live_grep, { desc = 'Telescope: Live grep' }) vim.keymap.set('n', 'fb', builtin.buffers, { desc = 'Telescope: Buffers' }) vim.keymap.set('n', 'fh', builtin.help_tags, { desc = 'Telescope: Help tags' }) end, }, { 'folke/TokyoNight.nvim', config = function() vim.cmd('colorscheme tokyonight-storm') end }, { 'hrsh7th/nvim-cmp', event = 'InsertEnter', dependencies = { { 'hrsh7th/cmp-buffer' }, { 'hrsh7th/cmp-path' }, { 'delphinus/cmp-ctags' } }, config = function() local cmp = require('cmp') cmp.setup({ mapping = cmp.mapping.preset.insert({ [''] = cmp.mapping.complete(), [''] = cmp.mapping.confirm({ select = true }), [''] = cmp.mapping.abort(), [''] = cmp.mapping.select_next_item(), [''] = cmp.mapping.select_prev_item(), }), sources = { { name = 'buffer' }, { name = 'path' }, { name = 'ctags' }, } }) end }, { 'ludovicchabant/vim-gutentags' }, }, -- Configure any other settings here. See the documentation for more details. -- colorscheme that will be used when installing plugins. install = { colorscheme = { "habamax" } }, -- automatically check for plugin updates checker = { enabled = true }, }) -- }}}