diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 01cfdb7..9e7614d 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -4,15 +4,15 @@ ]]-- local opt = vim.opt -- Convenient alias -local highlight = vim.api.nvim_set_hl -- Convenient alias local keymap = vim.api.nvim_set_keymap -- Convenient alias local autocmd = vim.api.nvim_create_autocmd -- Convenient alias local defaultKeybindOptions = { noremap = true, silent = true } -- Default keybind options LoadPreviousSessionOnLoad = true -- Load previous session or not SessionFile = '~/.config/nvim/.session.nvim' -- File where the previous buffer is stored -LeaderKey = ' ' -- The leader key to use. Default is the space key. -Theme = 'onenord' -- Theme to use +LeaderKey = ' ' -- The leader key to use. +MaxAccelerationSpeed = 300 -- Max speed for j/k/gj/gk bindings. +Theme = 'oxocarbon' -- Theme to use Languages = { -- Languages to support - Used to configure highlighting 'html', -- For HTML 'css', -- For CSS @@ -31,8 +31,9 @@ LanguageServers = { -- Language servers to use for LSP, run LspInstall to 'marksman', -- For Markdown } Themes = { - { 'rmehri01/onenord.nvim', branch = 'main' }, -- One Nord theme + { 'nyoom-engineering/oxocarbon.nvim' }, -- Oxocarbon --[[ + { 'rmehri01/onenord.nvim', branch = 'main' }, -- One Nord theme { 'romgrk/doom-one.vim' }, -- Doom-One theme { 'catppuccin/nvim' }, -- Catppuccin theme(s) ]]-- @@ -48,7 +49,7 @@ Plugins = { -- Plugins to use { 'nvim-lualine/lualine.nvim' }, -- Status line { 'm4xshen/autoclose.nvim' }, -- Autoclose brackets { 'stevearc/conform.nvim' }, -- Formatting - { 'tpope/vim-fugitive' }, -- Git integration + { 'dinhhuy258/git.nvim' }, -- Git integration { 'lewis6991/gitsigns.nvim' }, -- Provides Git icons { 'nvim-tree/nvim-web-devicons' }, -- Provides general icons { 'williamboman/mason.nvim', @@ -77,9 +78,12 @@ Plugins = { -- Plugins to use 'MunifTanjim/nui.nvim', 'rcarriga/nvim-notify', }, - opts = { - }, + opts = {}, }, -- Message boxes + { 'rainbowhxch/accelerated-jk.nvim' }, -- Accelerated movement + { 'NvChad/nvim-colorizer.lua' }, -- Colorize #RRGGBB text + { 'RRethy/vim-illuminate' }, -- Highlight other instances of the cursor position word + { 'LunarVim/bigfile.nvim' }, -- Disable heavy features if the file is big } require('bootstrap') -- Set up Lazy and plugins. @@ -109,10 +113,9 @@ opt.laststatus = 0 -- Don't display file information opt.termguicolors = true -- Enable true color opt.autochdir = true -- Automatically change directory to the file we're editing opt.background = 'dark' -- Set background to dark - --- Enable undercurl -highlight(0, 'SpellBad', { undercurl=true, fg='#ff0000' }) -highlight(0, 'SpellCap', { undercurl=true, fg='#ffff00' }) +opt.fillchars = { + vert = '▏', +} -- Keybinds for handling splits keymap('n', '', 'h', defaultKeybindOptions) @@ -138,11 +141,17 @@ keymap('n', '', 'silent execute "!setxkbmap se"', defaultKeyb keymap('n', 'ca', 'z=', defaultKeybindOptions) -- Miscellanious +keymap('n', '', 'tab :new', defaultKeybindOptions) +keymap('n', 'j', '(accelerated_jk_j)', defaultKeybindOptions) +keymap('n', 'k', '(accelerated_jk_k)', defaultKeybindOptions) +keymap('n', 'gj', '(accelerated_jk_gj)', defaultKeybindOptions) +keymap('n', 'gk', '(accelerated_jk_gk)', defaultKeybindOptions) keymap('n', 'd', '"_d', defaultKeybindOptions) keymap('x', 'd', '"_d', defaultKeybindOptions) keymap('x', 'p', '"_dP', defaultKeybindOptions) keymap('n', 'c', '"_c', defaultKeybindOptions) keymap('n', 'ZX', 'q!', defaultKeybindOptions) +keymap('n', 'Zz', 'w!', defaultKeybindOptions) keymap('n', '', 'v/{%', defaultKeybindOptions) keymap('n', '', 'NvimTreeToggle', defaultKeybindOptions) keymap('n', '', 'TroubleToggle', defaultKeybindOptions) @@ -150,6 +159,7 @@ keymap('n', '', 'TroubleToggle', defaultKeyb -- Keybinds for handling tabs keymap('n', '', 'BufferLineCyclePrev', defaultKeybindOptions) keymap('n', '', 'BufferLineCycleNext', defaultKeybindOptions) +keymap('n', '', 'BufferLineCycleNext', defaultKeybindOptions) keymap('n', '', 'BufferLineMovePrev', defaultKeybindOptions) keymap('n', '>', 'BufferLineMoveNext', defaultKeybindOptions) keymap('n', '', 'BufferLineGoToBuffer 1', defaultKeybindOptions) @@ -183,17 +193,3 @@ autocmd('BufWritePre', { -- Replace four spaces with tabs in Makefiles vim.cmd("autocmd BufWritePre Makefile %s/ /\t/e") end, }) - --- Set up various plugins -require('conform_config') -require('autoclose_config') -require('lsp_config') -require('lualine_config') -require('ibl_config') -require('bufferline_config') -require('tree_config') -require('ts_config') -require('theme_config') -require('trouble_config') -require('translate_config') -require('session_manager') diff --git a/.config/nvim/lua/accelerated_config.lua b/.config/nvim/lua/accelerated_config.lua new file mode 100644 index 0000000..4806f3f --- /dev/null +++ b/.config/nvim/lua/accelerated_config.lua @@ -0,0 +1,14 @@ +--[[ + speedie's neovim configuration + -- https://git.speedie.site/speedie/speedie-nvim -- +]]-- + +require("accelerated-jk").setup({ + mode = 'time_driven', + enable_deceleration = false, + acceleration_motions = {}, + acceleration_limit = MaxAccelerationSpeed, + acceleration_table = { 7,12,17,21,24,26,28,30 }, + -- when 'enable_deceleration = true', 'deceleration_table = { {200, 3}, {300, 7}, {450, 11}, {600, 15}, {750, 21}, {900, 9999} }' + deceleration_table = { {MaxAccelerationSpeed, 9999} } +}) diff --git a/.config/nvim/lua/bigfile_config.lua b/.config/nvim/lua/bigfile_config.lua new file mode 100644 index 0000000..89f892d --- /dev/null +++ b/.config/nvim/lua/bigfile_config.lua @@ -0,0 +1,6 @@ +--[[ + speedie's neovim configuration + -- https://git.speedie.site/speedie/speedie-nvim -- +]]-- + +require('bigfile').setup({}) diff --git a/.config/nvim/lua/bootstrap.lua b/.config/nvim/lua/bootstrap.lua index 0316570..a8fb6d5 100644 --- a/.config/nvim/lua/bootstrap.lua +++ b/.config/nvim/lua/bootstrap.lua @@ -28,3 +28,4 @@ local function combineTable(table1,table2) end require("lazy").setup(combineTable(Plugins, Themes)) +require("setup") diff --git a/.config/nvim/lua/colorizer_config.lua b/.config/nvim/lua/colorizer_config.lua new file mode 100644 index 0000000..c32fd93 --- /dev/null +++ b/.config/nvim/lua/colorizer_config.lua @@ -0,0 +1,13 @@ +--[[ + speedie's neovim configuration + -- https://git.speedie.site/speedie/speedie-nvim -- +]]-- + +require('colorizer').setup({}) + +vim.api.nvim_create_autocmd('VimEnter', { -- Save session on exit + pattern = { '*' }, + callback = function() + vim.cmd('ColorizerAttachToBuffer') + end, +}) diff --git a/.config/nvim/lua/git_config.lua b/.config/nvim/lua/git_config.lua new file mode 100644 index 0000000..4fb4088 --- /dev/null +++ b/.config/nvim/lua/git_config.lua @@ -0,0 +1,6 @@ +--[[ + speedie's neovim configuration + -- https://git.speedie.site/speedie/speedie-nvim -- +]]-- + +require('git').setup({}) diff --git a/.config/nvim/lua/illuminate_config.lua b/.config/nvim/lua/illuminate_config.lua new file mode 100644 index 0000000..032adfa --- /dev/null +++ b/.config/nvim/lua/illuminate_config.lua @@ -0,0 +1,12 @@ +--[[ + speedie's neovim configuration + -- https://git.speedie.site/speedie/speedie-nvim -- +]]-- + +require('illuminate').configure({ + providers = { + 'lsp', + 'treesitter', + 'regex', + }, +}) diff --git a/.config/nvim/lua/lualine_config.lua b/.config/nvim/lua/lualine_config.lua index b88f776..0bdebef 100644 --- a/.config/nvim/lua/lualine_config.lua +++ b/.config/nvim/lua/lualine_config.lua @@ -10,15 +10,17 @@ local lualine = require('lualine') local colors = { bg = '#202328', fg = '#bbc2cf', - yellow = '#ECBE7B', + yellow = '#ECBE7B', cyan = '#008080', - darkblue = '#081633', + darkblue = '#081633', green = '#98be65', - orange = '#FF8800', - violet = '#a9a1e1', - magenta = '#c678dd', + orange = '#FF8800', + violet = '#a9a1e1', + magenta = '#c678dd', blue = '#51afef', red = '#ec5f67', + pink = '#eba8ff', + sep = '#222222', } local conditions = { @@ -76,9 +78,9 @@ end ins_left { function() - return '▊' + return ' ' end, - color = { fg = colors.blue }, -- Sets highlighting of component + color = { fg = colors.bg }, -- Sets highlighting of component padding = { left = 0, right = 1 }, -- We don't need space before this } @@ -113,24 +115,55 @@ ins_left { } return { fg = mode_color[vim.fn.mode()] } end, - padding = { right = 1 }, + padding = { right = 0 }, } +-- Some padding +ins_left { + function() + return '▏' + end, + color = { fg = colors.sep }, + padding = { left = 3, right = 1 }, +} + +--[[ Looks good, but takes up quite a bit of space, so I think I'm good. +ins_left { + 'datetime', + icons_enabled = true, + icon = '󰥔', + color = { fg = colors.violet, gui = 'bold' }, + style = "%T", +} +--]] + ins_left { - -- filesize component - 'filesize', - cond = conditions.buffer_not_empty, + 'filetype', + fmt = string.upper, + icons_enabled = true, + icon_only = true, + color = { fg = colors.magenta, gui = 'bold' }, } - ins_left { 'filename', cond = conditions.buffer_not_empty, + icons_enabled = false, color = { fg = colors.magenta, gui = 'bold' }, } -ins_left { 'location' } +ins_left { + 'location', + icons_enabled = true, + icon = ''; + color = { fg = colors.red, gui = 'bold' }, +} -ins_left { 'progress', color = { fg = colors.fg, gui = 'bold' } } +ins_left { + 'progress', + icons_enabled = true, + icon = '󰹺', + color = { fg = colors.pink, gui = 'bold' }, +} ins_left { 'diagnostics', @@ -151,19 +184,31 @@ ins_left { end, } +ins_right { + -- search component + 'searchcount', + icons_enabled = true, + icon = '', + color = { fg = colors.violet, gui = 'bold' }, +} + +ins_right { + -- filesize component + 'filesize', + icons_enabled = true, + icon = '󰉉', + color = { fg = colors.orange, gui = 'bold' }, + cond = conditions.buffer_not_empty, +} + -- Add components to right sections ins_right { 'o:encoding', -- option component same as &encoding in viml fmt = string.upper, -- I'm not sure why it's upper case either ;) cond = conditions.hide_in_width, color = { fg = colors.green, gui = 'bold' }, -} - -ins_right { - 'fileformat', - fmt = string.upper, - icons_enabled = false, -- I think icons are cool but Eviline doesn't have them. sigh - color = { fg = colors.green, gui = 'bold' }, + icons_enabled = true, + icon = '󰉢'; } ins_right { @@ -174,7 +219,6 @@ ins_right { ins_right { 'diff', - -- Is it me or the symbol for modified us really weird symbols = { added = ' ', modified = '󰝤 ', removed = ' ' }, diff_color = { added = { fg = colors.green }, @@ -184,11 +228,24 @@ ins_right { cond = conditions.hide_in_width, } +ins_right { + 'fileformat', + fmt = string.upper, + symbols = { + unix = '', + dos = '', + mac = '', + }, + icons_enabled = true, + color = { fg = colors.blue, gui = 'bold' }, +} + +-- Some padding ins_right { function() - return '▊' + return ' ' end, - color = { fg = colors.blue }, + color = { fg = colors.bg }, padding = { left = 1 }, } diff --git a/.config/nvim/lua/setup.lua b/.config/nvim/lua/setup.lua new file mode 100644 index 0000000..72b3f11 --- /dev/null +++ b/.config/nvim/lua/setup.lua @@ -0,0 +1,27 @@ +--[[ + speedie's neovim configuration + -- https://git.speedie.site/speedie/speedie-nvim -- +]]-- + +--[[ + This will include lua from the ~/.config/nvim/lua/ directory. + If you want plugins to have special settings, you should modify those + Lua files. +--]] +require('conform_config') +require('autoclose_config') +require('lsp_config') +require('lualine_config') +require('ibl_config') +require('bufferline_config') +require('tree_config') +require('ts_config') +require('theme_config') +require('trouble_config') +require('translate_config') +require('accelerated_config') +require('git_config') +require('colorizer_config') +require('illuminate_config') +require('bigfile_config') +require('session_manager') diff --git a/README.md b/README.md index 147563c..ee42731 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # speedie-nvim -![img](/preview.png) +![img](/screenshots/scr0.png) +![img](/screenshots/scr1.png) My personal neovim configuration. Designed to be an IDE replacement for me. If you prefer something lighter, check out my [speedie-vim](https://git.speedie.site/speedie/speedie-vim) configuration instead. @@ -12,7 +13,7 @@ can change whenever I feel like it. **This is not a NeoVim distro.** - Fully configured in Lua - Easy, clean and concise configuration file -- Neovim-native LSP for different languages (default: HTML, CSS, C, C++, PHP, Lua, VimScript and Markdown) (using lsp-zero) +- Neovim-native LSP for different languages (default: HTML, CSS, C, C++, PHP, Lua and Markdown) (using lsp-zero) - Language syntax highlighting (using Treesitter) - Tabs (using barbar) - Doom-One colorscheme (using doom-one.vim) @@ -29,6 +30,7 @@ can change whenever I feel like it. **This is not a NeoVim distro.** - curl. - Good internet connection so you can download things. - Preferably also nerd fonts, or stuff might look a bit weird. + - To install them, you can use the included `install_fonts.sh` script. ## Installation diff --git a/commit.sh b/commit.sh index 52f882b..e768b29 100755 --- a/commit.sh +++ b/commit.sh @@ -7,7 +7,7 @@ if [ -e "$HOME/.config/nvim" ]; then rm -rf .config/nvim/.session.nvim rm -rf .config/nvim/lazy-lock.json - git add .config/* commit.sh install.sh + git add .config/* screenshots/ commit.sh install.sh git commit -a -m "speedie-nvim | Add new config" git push fi diff --git a/install_fonts.sh b/install_fonts.sh new file mode 100755 index 0000000..9aacfb6 --- /dev/null +++ b/install_fonts.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +mkdir -p tmp/ || exit 1 +mkdir -p $HOME/.local/share/fonts/Noto-Nerd-Fonts || exit 1 +cd tmp/ || exit 1 + +wget https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Noto.tar.xz || exit 1 +[ ! -f "Noto.tar.xz" ] && exit 1 +tar -xpvf Noto.tar.xz || exit 1 +cp *.ttf $HOME/.local/share/fonts/Noto-Nerd-Fonts/ || exit 1 + +cd .. + +rm -rf tmp/ || exit 1 diff --git a/screenshots/scr0.png b/screenshots/scr0.png new file mode 100644 index 0000000..9c8feeb Binary files /dev/null and b/screenshots/scr0.png differ diff --git a/preview.png b/screenshots/scr1.png similarity index 100% rename from preview.png rename to screenshots/scr1.png