speedie-nvim | Add new config

This commit is contained in:
Jacob 2024-01-20 20:51:01 +01:00
parent f01ee3940e
commit 64f1aef2f8
14 changed files with 200 additions and 52 deletions

View file

@ -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 <lang> 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', '<C-h>', '<C-w>h', defaultKeybindOptions)
@ -138,11 +141,17 @@ keymap('n', '<F8>', '<cmd>silent execute "!setxkbmap se"<cr>', defaultKeyb
keymap('n', 'ca', 'z=', defaultKeybindOptions)
-- Miscellanious
keymap('n', '<C-n>', '<cmd>tab :new<cr>', defaultKeybindOptions)
keymap('n', 'j', '<Plug>(accelerated_jk_j)', defaultKeybindOptions)
keymap('n', 'k', '<Plug>(accelerated_jk_k)', defaultKeybindOptions)
keymap('n', 'gj', '<Plug>(accelerated_jk_gj)', defaultKeybindOptions)
keymap('n', 'gk', '<Plug>(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', '<cmd>q!<cr>', defaultKeybindOptions)
keymap('n', 'Zz', '<cmd>w!<cr>', defaultKeybindOptions)
keymap('n', '<C-A>', 'v/{<cr>%', defaultKeybindOptions)
keymap('n', '<C-e>', '<cmd>NvimTreeToggle<cr>', defaultKeybindOptions)
keymap('n', '<C-b>', '<cmd>TroubleToggle<cr>', defaultKeybindOptions)
@ -150,6 +159,7 @@ keymap('n', '<C-b>', '<cmd>TroubleToggle<cr>', defaultKeyb
-- Keybinds for handling tabs
keymap('n', '<A-,>', '<cmd>BufferLineCyclePrev<cr>', defaultKeybindOptions)
keymap('n', '<A-.>', '<cmd>BufferLineCycleNext<cr>', defaultKeybindOptions)
keymap('n', '<C-Tab>', '<cmd>BufferLineCycleNext<cr>', defaultKeybindOptions)
keymap('n', '<A-<>', '<cmd>BufferLineMovePrev<cr>', defaultKeybindOptions)
keymap('n', '<A->>', '<cmd>BufferLineMoveNext<cr>', defaultKeybindOptions)
keymap('n', '<A-1>', '<cmd>BufferLineGoToBuffer 1<cr>', 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')

View file

@ -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} }
})

View file

@ -0,0 +1,6 @@
--[[
speedie's neovim configuration
-- https://git.speedie.site/speedie/speedie-nvim --
]]--
require('bigfile').setup({})

View file

@ -28,3 +28,4 @@ local function combineTable(table1,table2)
end
require("lazy").setup(combineTable(Plugins, Themes))
require("setup")

View file

@ -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,
})

View file

@ -0,0 +1,6 @@
--[[
speedie's neovim configuration
-- https://git.speedie.site/speedie/speedie-nvim --
]]--
require('git').setup({})

View file

@ -0,0 +1,12 @@
--[[
speedie's neovim configuration
-- https://git.speedie.site/speedie/speedie-nvim --
]]--
require('illuminate').configure({
providers = {
'lsp',
'treesitter',
'regex',
},
})

View file

@ -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 },
}

View file

@ -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')

View file

@ -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

View file

@ -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

14
install_fonts.sh Executable file
View file

@ -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

BIN
screenshots/scr0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 KiB

View file

Before

Width:  |  Height:  |  Size: 294 KiB

After

Width:  |  Height:  |  Size: 294 KiB