diff --git a/init.lua b/init.lua index 08717d53..7c279284 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' @@ -111,6 +111,35 @@ vim.opt.mouse = 'a' vim.opt.showmode = false -- Sync clipboard between OS and Neovim. +vim.opt.clipboard = 'unnamedplus' +vim.opt.wrap = false -- Displays Lines as one long line +vim.opt.linebreak = true -- Companion to wrap, dont break lines +vim.opt.autoindent = true +vim.opt.shiftwidth = 4 -- The number of spaces inserted for each indentation +vim.opt.tabstop = 4 --Inserts n spaces for a Tab +vim.opt.softtabstop = 4 -- +vim.opt.expandtab = true -- Converts tabs into spaces +vim.o.scrolloff = 4 -- Minimal number of screen lines to keep above and below the cursor (default: 0) +vim.o.sidescrolloff = 8 -- Minimal number of screen columns either side of cursor if wrap is `false` (default: 0) +vim.o.hlsearch = false -- Set highlight on search (default: true) +vim.opt.termguicolors = true -- Set termguicolors to enable highlight groups (default: false) +vim.o.whichwrap = 'bs<>[]hl' -- Which "horizontal" keys are allowed to travel to prev/next line (default: 'b,s') +vim.o.numberwidth = 4 -- Set number column width to 2 {default 4} (default: 4) +vim.o.swapfile = false -- Creates a swapfile (default: true) +vim.o.smartindent = true -- Make indenting smarter again (default: false) +vim.o.showtabline = 2 -- Always show tabs (default: 1) +vim.o.backspace = 'indent,eol,start' -- Allow backspace on (default: 'indent,eol,start') +vim.o.pumheight = 10 -- Pop up menu height (default: 0) +vim.o.conceallevel = 0 -- So that `` is visible in markdown files (default: 1) +vim.o.fileencoding = 'utf-8' -- The encoding written to a file (default: 'utf-8') +vim.o.cmdheight = 1 -- More space in the Neovim command line for displaying messages (default: 1) +vim.o.writebackup = false -- If a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited (default: true) +vim.o.completeopt = 'menuone,noselect' -- Set completeopt to have a better completion experience (default: 'menu,preview') +vim.opt.shortmess:append 'c' -- Don't give |ins-completion-menu| messages (default: does not include 'c') +vim.opt.iskeyword:append '-' -- Hyphenated words recognized by searches (default: does not include '-') +vim.opt.formatoptions:remove { 'c', 'r', 'o' } -- Don't insert the current comment leader automatically for auto-wrapping comments using 'textwidth', hitting in insert mode, or hitting 'o' or 'O' in normal mode. (default: 'croql') +vim.opt.runtimepath:remove '/usr/share/vim/vimfiles' -- Separate Vim plugins from Neovim in case Vim still in use (default: includes this path if Vim is installed) + -- Schedule the setting after `UiEnter` because it can increase startup-time. -- Remove this option if you want your OS clipboard to remain independent. -- See `:help 'clipboard'` @@ -152,7 +181,7 @@ vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } vim.opt.inccommand = 'split' -- Show which line your cursor is on -vim.opt.cursorline = true +vim.opt.cursorline = false -- Minimal number of screen lines to keep above and below the cursor. vim.opt.scrolloff = 10 @@ -615,10 +644,21 @@ require('lazy').setup({ -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - -- rust_analyzer = {}, + clangd = {}, -- C/C++/Objective-C + -- rust_analyzer = {}, -- Rust + pyright = {}, -- Python + -- sumneko_lua = {}, -- Lua + -- intelephense = {}, -- PHP + -- solargraph = {}, -- Ruby + -- jdtls = {}, -- Java + -- hls = {}, -- Haskell + -- sourcekit_lsp = {}, -- Swift + -- metals = {}, -- Scala + -- elixir_ls = {}, -- Elixir + -- omnisharp = {}, -- C# + -- dartls = {}, -- Dart/Flutter + jsonls = {}, -- JSON + -- yaml = {}, -- YAML -- ... 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: @@ -833,65 +873,84 @@ require('lazy').setup({ } end, }, + { -- mini.nvim (only keep ai + surround, drop statusline) + 'echasnovski/mini.nvim', + config = function() + require('mini.ai').setup { n_lines = 500 } + require('mini.surround').setup() + end, + }, - { -- You can easily change to a different colorscheme. - -- Change the name of the colorscheme plugin below, and then - -- change the command in the config to whatever the name of that colorscheme is. - -- - -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. + { -- Colorscheme (Tokyonight) 'folke/tokyonight.nvim', - priority = 1000, -- Make sure to load this before all the other start plugins. + priority = 1000, init = function() - -- Load the colorscheme here. - -- Like many other themes, this one has different styles, and you could load - -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' + vim.cmd.colorscheme 'tokyonight-night' + vim.cmd.hi 'Comment gui=none' +--[[ + vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) + vim.api.nvim_set_hl(0, "SignColumn", { bg = "none" }) + vim.api.nvim_set_hl(0, "LineNr", { bg = "none" }) + vim.api.nvim_set_hl(0, "EndOfBuffer", { bg = "none" })]] + end, + }, - -- You can configure highlights by doing something like: - vim.cmd.hi 'Comment gui=none' + { -- Evil Lualine (statusline) + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + require('lualine').setup { + options = { + theme = 'tokyonight', + icons_enabled = true, + component_separators = { left = '│', right = '│' }, + section_separators = { left = '', right = '' }, + }, + sections = { + lualine_a = { 'mode' }, + lualine_b = { 'branch', 'diff', 'diagnostics' }, + lualine_c = { { 'filename', path = 1 } }, + lualine_x = { 'encoding', 'fileformat', 'filetype' }, + lualine_y = { 'progress' }, + lualine_z = { 'location' }, + }, + } end, }, - -- Highlight todo, notes, etc in comments - { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, - - { -- Collection of various small independent plugins/modules - 'echasnovski/mini.nvim', + { -- Bufferline (tabs at the top) + 'akinsho/bufferline.nvim', + version = '*', + dependencies = { 'nvim-tree/nvim-web-devicons', 'folke/tokyonight.nvim' }, config = function() - -- Better Around/Inside textobjects - -- - -- Examples: - -- - va) - [V]isually select [A]round [)]paren - -- - yinq - [Y]ank [I]nside [N]ext [Q]uote - -- - ci' - [C]hange [I]nside [']quote - require('mini.ai').setup { n_lines = 500 } + require("bufferline").setup { + options = { + mode = "buffers", + diagnostics = "nvim_lsp", + separator_style = "slant", + show_buffer_close_icons = false, + show_close_icon = false, + always_show_bufferline = true, + offsets = { + { + filetype = "NvimTree", + text = "File Explorer", + highlight = "Directory", + separator = true, + }, + }, + }, + highlights = require("tokyonight.groups").bufferline, + } - -- Add/delete/replace surroundings (brackets, quotes, etc.) - -- - -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren - -- - sd' - [S]urround [D]elete [']quotes - -- - sr)' - [S]urround [R]eplace [)] ['] - require('mini.surround').setup() - - -- Simple and easy statusline. - -- You could remove this setup call if you don't like it, - -- and try some other statusline plugin - local statusline = require 'mini.statusline' - -- set use_icons to true if you have a Nerd Font - statusline.setup { use_icons = vim.g.have_nerd_font } - - -- You can configure sections in the statusline by overriding their - -- default behavior. For example, here we set the section for - -- cursor location to LINE:COLUMN - ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() - return '%2l:%-2v' - end - - -- ... and there is more! - -- Check out: https://github.com/echasnovski/mini.nvim + -- Optional: dim inactive buffers + vim.api.nvim_set_hl(0, "BufferLineBackground", { fg = "#565f89", bg = "#1a1b26" }) + vim.api.nvim_set_hl(0, "BufferLineBufferVisible", { fg = "#565f89", bg = "#1a1b26" }) + vim.api.nvim_set_hl(0, "BufferLineBufferSelected", { fg = "#c0caf5", bg = "#1f2335", bold = true }) end, }, + { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', @@ -927,18 +986,18 @@ require('lazy').setup({ -- Here are some example plugins that I've included in the Kickstart repository. -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- - -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', - -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'kickstart.plugins.debug', + require 'kickstart.plugins.indent_line', + require 'kickstart.plugins.lint', + require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.neo-tree', + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope!