trying out nix
This commit is contained in:
commit
65bd68a260
18 changed files with 1217 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
lazy-lock.json
|
||||||
|
|
||||||
19
flake.nix
Normal file
19
flake.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
description = "Personal neovim configuration";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, ... }:
|
||||||
|
let
|
||||||
|
system = "x86_64-linux";
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
in {
|
||||||
|
packages.${system}.nvimConfig = pkgs.runCommand "nvim-config" {} ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp -r ${self}/. $out
|
||||||
|
''
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
144
init.lua
Normal file
144
init.lua
Normal file
|
|
@ -0,0 +1,144 @@
|
||||||
|
require("config.lazy")
|
||||||
|
|
||||||
|
local colorini = require('colorini')
|
||||||
|
colorini.setup("green")
|
||||||
|
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.wrap = false
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd(
|
||||||
|
{ "InsertEnter", "FocusLost", "BufLeave" },
|
||||||
|
{
|
||||||
|
callback = function()
|
||||||
|
vim.opt.relativenumber = false
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd(
|
||||||
|
{ "InsertLeave", "FocusGained", "BufEnter" },
|
||||||
|
{
|
||||||
|
callback = function()
|
||||||
|
vim.opt.relativenumber = true
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
vim.opt.tabstop = 4
|
||||||
|
vim.opt.shiftwidth = 4
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
vim.opt.pumheight = 10
|
||||||
|
vim.opt.pumwidth = 80
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
vim.opt.ignorecase = true
|
||||||
|
vim.opt.smartcase = true
|
||||||
|
|
||||||
|
vim.o.updatetime = 100
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<Esc><Esc>", ":noh<CR>", { silent = true })
|
||||||
|
vim.keymap.set("v", "ga", ":EasyAlign<CR>")
|
||||||
|
vim.keymap.set("v", "<leader>c", '"+y', { desc = "Copy to system clipboard" })
|
||||||
|
|
||||||
|
function hex_to_rgb(hex)
|
||||||
|
hex = hex:gsub("#", "")
|
||||||
|
return tonumber(hex:sub(1,2),16), tonumber(hex:sub(3,4),16), tonumber(hex:sub(5,6),16)
|
||||||
|
end
|
||||||
|
|
||||||
|
function rgb_to_hex(r, g, b)
|
||||||
|
return string.format("#%02X%02X%02X", r,g,b)
|
||||||
|
end
|
||||||
|
|
||||||
|
function shade_color(hex, factor)
|
||||||
|
local r,g,b = hex_to_rgb(hex)
|
||||||
|
r = math.floor(r * factor)
|
||||||
|
g = math.floor(g * factor)
|
||||||
|
b = math.floor(b * factor)
|
||||||
|
return rgb_to_hex(r,g,b)
|
||||||
|
end
|
||||||
|
|
||||||
|
local orange = "#fd971f"
|
||||||
|
|
||||||
|
function do_stuff()
|
||||||
|
local highlights = vim.api.nvim_get_hl(0, {})
|
||||||
|
for name, hl in pairs(highlights) do
|
||||||
|
if hl.fg then
|
||||||
|
local factor = hl.fg / 0xFFFFFF
|
||||||
|
hl.fg = shade_color(orange, factor)
|
||||||
|
hl.bold = true
|
||||||
|
vim.api.nvim_set_hl(0, name, hl)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- TELESCOPE
|
||||||
|
local builtin = require("telescope.builtin")
|
||||||
|
vim.keymap.set("n", "<leader>ff", builtin.find_files, { desc = "Telescope find files" })
|
||||||
|
vim.keymap.set("n", "<leader>fg", builtin.live_grep, { desc = "Telescope live grep" })
|
||||||
|
vim.keymap.set("n", "<leader>fb", builtin.buffers, { desc = "Telescope buffers" })
|
||||||
|
vim.api.nvim_set_hl(0, "TelescopeSelection", { bg = "#2a2a2a", fg ="#ffffff" } )
|
||||||
|
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
|
||||||
|
-- LSP config
|
||||||
|
local lspconfig = require("lspconfig")
|
||||||
|
|
||||||
|
lspconfig.clangd.setup({
|
||||||
|
cmd = { "clangd", "--background-index", "--compile-commands-dir=.", "--header-insertion=never" },
|
||||||
|
root_dir = require("lspconfig.util").root_pattern("compile_commands.json", ".git"),
|
||||||
|
capabilities = require("cmp_nvim_lsp").default_capabilities(),
|
||||||
|
})
|
||||||
|
|
||||||
|
lspconfig.rust_analyzer.setup({
|
||||||
|
on_attach = function (client, bufnr)
|
||||||
|
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
|
||||||
|
end,
|
||||||
|
settings = {
|
||||||
|
["rust-analyzer"] = {
|
||||||
|
imports = {
|
||||||
|
granularity = {
|
||||||
|
group = "module",
|
||||||
|
},
|
||||||
|
prefix = "self",
|
||||||
|
},
|
||||||
|
cargo = {
|
||||||
|
buildScripts = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
procMacro = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.enable('gopls')
|
||||||
|
-- vim.lsp.enable('rust-analyzer')
|
||||||
|
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_text = false,
|
||||||
|
float = {
|
||||||
|
border = "rounded",
|
||||||
|
focusable = false,
|
||||||
|
source = "always",
|
||||||
|
scope = "line",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("CursorHold", {
|
||||||
|
callback = function()
|
||||||
|
vim.diagnostic.open_float(nil, {
|
||||||
|
focusable = false,
|
||||||
|
close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" },
|
||||||
|
border = "rounded",
|
||||||
|
source = "always",
|
||||||
|
scope = "line",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>ca", function()
|
||||||
|
vim.lsp.buf.code_action()
|
||||||
|
end, { desc = "Lsp code action" })
|
||||||
|
|
||||||
202
lua/colorini/config.lua
Normal file
202
lua/colorini/config.lua
Normal file
|
|
@ -0,0 +1,202 @@
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
M.highlights_base = function(colors, base)
|
||||||
|
local colorscheme = {
|
||||||
|
green = {
|
||||||
|
main = colors.green,
|
||||||
|
high = colors.orange_light,
|
||||||
|
main_dark = colors.green_dark,
|
||||||
|
extra = colors.green_dark,
|
||||||
|
},
|
||||||
|
orange = {
|
||||||
|
main = colors.orange_light,
|
||||||
|
high = colors.green,
|
||||||
|
main_dark = colors.orange,
|
||||||
|
extra = colors.orange,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
local selected = base or "green"
|
||||||
|
local main = colorscheme[selected].main
|
||||||
|
local high = colorscheme[selected].high
|
||||||
|
local main_dark = colorscheme[selected].main_dark
|
||||||
|
local extra = colorscheme[selected].extra
|
||||||
|
|
||||||
|
return {
|
||||||
|
Boolean = { fg = main },
|
||||||
|
Character = { fg = high },
|
||||||
|
ColorColumn = { bg = colors.background },
|
||||||
|
Comment = { fg = colors.light_gray },
|
||||||
|
Conditional = { fg = main_dark },
|
||||||
|
Constant = { fg = high },
|
||||||
|
Cursor = { fg = colors.white, bg = main },
|
||||||
|
CursorColumn = { bg = colors.gray },
|
||||||
|
CursorIM = { fg = colors.foreground, bg = colors.cursor },
|
||||||
|
CursorLine = { bg = colors.gray },
|
||||||
|
CursorLineNr = { fg = main },
|
||||||
|
Debug = { fg = colors.blue },
|
||||||
|
Define = { fg = extra },
|
||||||
|
Delimiter = { fg = colors.white },
|
||||||
|
DiffAdd = { fg = colors.white, bg = main },
|
||||||
|
DiffChange = { fg = colors.white, bg = main },
|
||||||
|
DiffDelete = { fg = colors.white, bg = colors.red },
|
||||||
|
DiffText = { fg = colors.foreground, bg = main },
|
||||||
|
Directory = { fg = high },
|
||||||
|
EndOfBuffer = { fg = colors.gray, bg = colors.transparent },
|
||||||
|
-- for some reason every single squirly bracket in c appears red if i leave this red????
|
||||||
|
Error = { fg = main, bg = colors.transparent },
|
||||||
|
ErrorMsg = { fg = colors.red, bg = colors.transparent },
|
||||||
|
Exception = { fg = colors.red },
|
||||||
|
Float = { fg = main },
|
||||||
|
FloatBorder = { fg = main, bg = colors.transparent },
|
||||||
|
FoldColumn = { fg = main, bg = colors.transparent },
|
||||||
|
Folded = { fg = main, bg = colors.transparent },
|
||||||
|
Function = { fg = main_dark },
|
||||||
|
Identifier = { fg = main },
|
||||||
|
Ignore = { fg = colors.light_gray, bg = colors.transparent },
|
||||||
|
IncSearch = { fg = colors.white, bg = high },
|
||||||
|
Include = { fg = main },
|
||||||
|
Keyword = { fg = high },
|
||||||
|
Label = { fg = extra },
|
||||||
|
LineNr = { fg = colors.light_gray, bg = colors.transparent },
|
||||||
|
LineNrAbove = { fg = colors.light_gray, bg = colors.transparent },
|
||||||
|
LineNrBelow = { fg = colors.light_gray, bg = colors.transparent },
|
||||||
|
Macro = { fg = extra },
|
||||||
|
MatchParen = { fg = colors.white, bg = main },
|
||||||
|
ModeMsg = { fg = main, bg = colors.transparent },
|
||||||
|
MoreMsg = { fg = main },
|
||||||
|
MsgArea = { fg = main, bg = colors.transparent },
|
||||||
|
MsgSeparator = { fg = colors.gray, bg = colors.transparent },
|
||||||
|
NonText = { fg = colors.gray },
|
||||||
|
Normal = { fg = main, bg = colors.transparent },
|
||||||
|
NormalFloat = { fg = main, bg = colors.background },
|
||||||
|
NormalNC = { fg = main, bg = colors.transparent },
|
||||||
|
Number = { fg = high },
|
||||||
|
Operator = { fg = main },
|
||||||
|
Pmenu = { fg = colors.white, bg = colors.black },
|
||||||
|
PmenuSbar = { fg = colors.white, bg = main },
|
||||||
|
PmenuSel = { fg = colors.white, bg = main },
|
||||||
|
PmenuThumb = { bg = main },
|
||||||
|
PreCondit = { fg = main_dark },
|
||||||
|
PreProc = { fg = main_dark },
|
||||||
|
Question = { fg = main },
|
||||||
|
QuickFixLine = { bg = main, fg = colors.white },
|
||||||
|
Repeat = { fg = main },
|
||||||
|
Search = { fg = colors.white, bg = main },
|
||||||
|
SignColumn = { fg = colors.transparent, bg = colors.transparent },
|
||||||
|
Special = { fg = colors.yellow },
|
||||||
|
SpecialChar = { fg = main },
|
||||||
|
SpecialComment = { fg = colors.white },
|
||||||
|
SpecialKey = { fg = colors.white, bg = colors.red },
|
||||||
|
SpellBad = { fg = colors.red },
|
||||||
|
SpellCap = { fg = main },
|
||||||
|
SpellLocal = { fg = colors.yellow },
|
||||||
|
SpellRare = { fg = colors.blue },
|
||||||
|
Statement = { fg = main },
|
||||||
|
StatusLine = { fg = colors.transparent, bg = colors.transparent },
|
||||||
|
StatusLineNC = { fg = colors.transparent, bg = colors.transparent },
|
||||||
|
StorageClass = { fg = main },
|
||||||
|
String = { fg = high },
|
||||||
|
Structure = { fg = high },
|
||||||
|
Substitute = { fg = colors.white, bg = main },
|
||||||
|
Tag = { fg = high },
|
||||||
|
TermCursor = { fg = colors.foreground, bg = colors.cursor },
|
||||||
|
TermCursorNC = { fg = colors.foreground, bg = colors.cursor },
|
||||||
|
Title = { fg = main },
|
||||||
|
Todo = { fg = colors.white, bg = colors.transparent },
|
||||||
|
Type = { fg = main_dark },
|
||||||
|
Typedef = { fg = main_dark },
|
||||||
|
Variable = { fg = main },
|
||||||
|
VertSplit = { fg = colors.blue, bg = colors.transparent },
|
||||||
|
Visual = { fg = colors.white, bg = main },
|
||||||
|
VisualNOS = { bg = colors.transparent },
|
||||||
|
WarningMsg = { fg = colors.yellow, bg = colors.transparent },
|
||||||
|
Whitespace = { fg = colors.gray, bg = colors.background },
|
||||||
|
WildMenu = { fg = colors.white, bg = colors.white },
|
||||||
|
WinBar = { bg = colors.transparent },
|
||||||
|
WinBarNC = { bg = colors.transparent },
|
||||||
|
WinSeparator = { fg = colors.gray, bg = colors.transparent },
|
||||||
|
healthError = { fg = colors.red },
|
||||||
|
healthSuccess = { fg = colors.green },
|
||||||
|
healthWarning = { fg = colors.yellow },
|
||||||
|
lCursor = { fg = colors.foreground, bg = colors.cursor },
|
||||||
|
|
||||||
|
-- diagnostics
|
||||||
|
DiagnosticError = { fg = colors.red },
|
||||||
|
DiagnosticHint = { fg = colors.orange },
|
||||||
|
DiagnosticInfo = { fg = colors.white },
|
||||||
|
DiagnosticWarn = { fg = colors.yellow },
|
||||||
|
DiagnosticUnderlineError = { undercurl = true, fg = colors.red },
|
||||||
|
DiagnosticUnderlineHint = { undercurl = true, fg = colors.orange },
|
||||||
|
DiagnosticUnderlineInfo = { undercurl = true, fg = colors.white },
|
||||||
|
DiagnosticUnderlineWarn = { undercurl = true, fg = colors.yellow },
|
||||||
|
|
||||||
|
-- Telescope
|
||||||
|
TelescopeBorder = { fg = main, bg = colors.transparent },
|
||||||
|
TelescopeNormal = { fg = colors.white, bg = colors.transparent },
|
||||||
|
TelescopeSelection = { fg = colors.transparent, bg = main },
|
||||||
|
|
||||||
|
-- treesitter
|
||||||
|
-- These groups are for the neovim tree-sitter highlights.
|
||||||
|
-- As of writing, tree-sitter support is a WIP, group names may color5.
|
||||||
|
-- By default, most of these groups link to an appropriate Vim group,
|
||||||
|
-- TSError -> Error for example, so you do not have to define these unless
|
||||||
|
-- you explicitly want to support Treesitter's improved syntax awareness.
|
||||||
|
|
||||||
|
-- TSAnnotation = { }; -- For C++/Dart attributes, annotations that can be attached to the code to denote some kind of meta information.
|
||||||
|
-- TSBoolean = { }; -- For booleans.
|
||||||
|
-- TSCharacter = { }; -- For characters.
|
||||||
|
-- TSComment = { }; -- For blueblocks.
|
||||||
|
TSComment = { fg = colors.blue},
|
||||||
|
TSConstructor = { fg = colors.blue}, -- For constructor calls and definitions: `= { }` in Lua, and Java constructors.
|
||||||
|
TSDanger = { fg = colors.transparent, bg = colors.blue},
|
||||||
|
TSNote = { fg = colors.transparent, bg = colors.blue},
|
||||||
|
TSWarning = { fg = colors.transparent, bg = colors.blue},
|
||||||
|
-- TSConditional = { }; -- For keywords related to conditionnals.
|
||||||
|
-- TSConstant = { }; -- For constants
|
||||||
|
-- TSConstBuiltin = { }; -- For constant that are built in the language: `nil` in Lua.
|
||||||
|
-- TSConstMacro = { }; -- For constants that are defined by macros: `NULL` in C.
|
||||||
|
-- TSError = { }; -- For syntax/parser errors.
|
||||||
|
-- TSException = { }; -- For exception related keywords.
|
||||||
|
TSField = { fg = colors.blue }, -- For fields.
|
||||||
|
-- TSFloat = { }; -- For floats.
|
||||||
|
-- TSFunction = { }; -- For function (calls and definitions).
|
||||||
|
-- TSFuncBuiltin = { }; -- For builtin functions: `table.insert` in Lua.
|
||||||
|
-- TSFuncMacro = { }; -- For macro defined fuctions (calls and definitions): each `macro_rules` in Rust.
|
||||||
|
-- TSInclude = { }; -- For includes: `#include` in C, `use` or `extern crate` in Rust, or `require` in Lua.
|
||||||
|
TSKeyword = { fg = colors.blue}, -- For keywords that don't fall in previous categories.
|
||||||
|
TSKeywordFunction = { fg = colors.blue}, -- For keywords used to define a fuction.
|
||||||
|
TSLabel = { fg = colors.blue}, -- For labels: `label:` in C and `:label:` in Lua.
|
||||||
|
-- TSMethod = { }; -- For method calls and definitions.
|
||||||
|
-- TSNamespace = { }; -- For identifiers referring to modules and namespaces.
|
||||||
|
-- TSNone = { }; -- TODO: docs
|
||||||
|
-- TSNumber = { }; -- For all numbers
|
||||||
|
TSOperator = { fg = colors.blue}, -- For any operator: `+`, but also `->` and `*` in C.
|
||||||
|
TSParameter = { fg = colors.blue}, -- For parameters of a function.
|
||||||
|
-- TSParameterReference= { }; -- For references to parameters of a function.
|
||||||
|
TSProperty = { fg = colors.blue}, -- Same as `TSField`.
|
||||||
|
TSPunctDelimiter = { fg = colors.blue}, -- For delimiters ie: `.`
|
||||||
|
TSPunctBracket = { fg = colors.foreground }, -- For brackets and parens.
|
||||||
|
TSPunctSpecial = { fg = colors.blue}, -- For special punctutation that does not fall in the catagories before.
|
||||||
|
-- TSRepeat = { }; -- For keywords related to loops.
|
||||||
|
-- TSString = { }; -- For strings.
|
||||||
|
TSStringRegex = { fg = colors.blue}, -- For regexes.
|
||||||
|
TSStringEscape = { fg = colors.blue}, -- For escape characters within a string.
|
||||||
|
-- TSSymbol = { }; -- For identifiers referring to symbols or atoms.
|
||||||
|
-- TSType = { }; -- For types.
|
||||||
|
-- TSTypeBuiltin = { }; -- For builtin types.
|
||||||
|
TSVariableBuiltin = { fg = colors.blue }, -- Variable names that are defined by the languages, like `this` or `self`.
|
||||||
|
|
||||||
|
-- TSTag = { }; -- Tags like html tag names.
|
||||||
|
-- TSTagDelimiter = { }; -- Tag delimiter like `<` `>` `/`
|
||||||
|
-- TSText = { }; -- For strings considered text in a markup language.
|
||||||
|
TSTextReference = { fg = colors.blue},
|
||||||
|
-- TSEmphasis = { }; -- For text to be represented with emphasis.
|
||||||
|
-- TSUnderline = { }; -- For text to be represented with an underline.
|
||||||
|
-- TSStrike = { }; -- For strikethrough text.
|
||||||
|
-- TSTitle = { }; -- Text that is part of a title.
|
||||||
|
-- TSLiteral = { }; -- Literal text.
|
||||||
|
-- TSURI = { }; -- Any URI like a link or email.
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
44
lua/colorini/core.lua
Normal file
44
lua/colorini/core.lua
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
local colors = {
|
||||||
|
green = "#459A65",
|
||||||
|
green_dark = "#006666",
|
||||||
|
orange = "#EE7B3B",
|
||||||
|
orange_light = "#FD971F",
|
||||||
|
yellow = "#F6C443",
|
||||||
|
gray = "#161616",
|
||||||
|
light_gray = "#464646",
|
||||||
|
blue = "#3276F6",
|
||||||
|
red = "#CD0300",
|
||||||
|
magenta = "#EA3D8D",
|
||||||
|
white = "#FFFFFF",
|
||||||
|
black = "#000000",
|
||||||
|
}
|
||||||
|
|
||||||
|
colors.background = colors.black
|
||||||
|
colors.foreground = colors.green
|
||||||
|
colors.cursor = colors.orange
|
||||||
|
|
||||||
|
function M.get_colors()
|
||||||
|
return {
|
||||||
|
transparent = "NONE",
|
||||||
|
background = colors.background,
|
||||||
|
foreground = colors.foreground,
|
||||||
|
cursor = colors.cursor,
|
||||||
|
|
||||||
|
white = colors.white,
|
||||||
|
black = colors.black,
|
||||||
|
green = colors.green,
|
||||||
|
green_dark = colors.green_dark,
|
||||||
|
orange = colors.orange,
|
||||||
|
orange_light = colors.orange_light,
|
||||||
|
yellow = colors.yellow,
|
||||||
|
gray = colors.gray,
|
||||||
|
light_gray = colors.light_gray,
|
||||||
|
blue = colors.blue,
|
||||||
|
red = colors.red,
|
||||||
|
magenta = colors.magenta,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
432
lua/colorini/feline.lua
Normal file
432
lua/colorini/feline.lua
Normal file
|
|
@ -0,0 +1,432 @@
|
||||||
|
local lsp = require("feline.providers.lsp")
|
||||||
|
local lsp_severity = vim.diagnostic.severity
|
||||||
|
local b = vim.b
|
||||||
|
|
||||||
|
local assets = {
|
||||||
|
left_semicircle = "",
|
||||||
|
right_semicircle = "",
|
||||||
|
right_semicircle_cut = "",
|
||||||
|
left_semicircle_cut = "",
|
||||||
|
vertical_bar_chubby = "█",
|
||||||
|
vertical_bar_medium = "┃",
|
||||||
|
vertical_bar_thin = "│",
|
||||||
|
left_arrow_thin = "",
|
||||||
|
right_arrow_thin = "",
|
||||||
|
left_arrow_filled = "",
|
||||||
|
right_arrow_filled = "",
|
||||||
|
slant_left = "",
|
||||||
|
slant_left_thin = "",
|
||||||
|
slant_right = "",
|
||||||
|
slant_right_thin = "",
|
||||||
|
slant_left_2 = "",
|
||||||
|
slant_left_2_thin = "",
|
||||||
|
slant_right_2 = "",
|
||||||
|
slant_right_2_thin = "",
|
||||||
|
chubby_dot = "●",
|
||||||
|
slim_dot = '•',
|
||||||
|
}
|
||||||
|
|
||||||
|
local colors = require('pywal16.core').get_colors()
|
||||||
|
|
||||||
|
-- settings
|
||||||
|
local sett = {
|
||||||
|
bkg = colors.background,
|
||||||
|
diffs = colors.color1,
|
||||||
|
extras = colors.color5,
|
||||||
|
curr_file = colors.color4,
|
||||||
|
curr_dir = colors.color4,
|
||||||
|
}
|
||||||
|
|
||||||
|
local mode_colors = {
|
||||||
|
["n"] = { "NORMAL", colors.color1 },
|
||||||
|
["no"] = { "N-PENDING", colors.color1 },
|
||||||
|
["i"] = { "INSERT", colors.color1 },
|
||||||
|
["ic"] = { "INSERT", colors.color1 },
|
||||||
|
["t"] = { "TERMINAL", colors.color1 },
|
||||||
|
["v"] = { "VISUAL", colors.color3 },
|
||||||
|
["V"] = { "V-LINE", colors.color3 },
|
||||||
|
[""] = { "V-BLOCK", colors.color3 },
|
||||||
|
["R"] = { "REPLACE", colors.color4 },
|
||||||
|
["Rv"] = { "V-REPLACE", colors.color4 },
|
||||||
|
["s"] = { "SELECT", colors.color4 },
|
||||||
|
["S"] = { "S-LINE", colors.color4 },
|
||||||
|
[""] = { "S-BLOCK", colors.color4 },
|
||||||
|
["c"] = { "COMMAND", colors.color6 },
|
||||||
|
["cv"] = { "COMMAND", colors.color6 },
|
||||||
|
["ce"] = { "COMMAND", colors.color6 },
|
||||||
|
["r"] = { "PROMPT", colors.color7 },
|
||||||
|
["rm"] = { "MORE", colors.color7 },
|
||||||
|
["r?"] = { "CONFIRM", colors.color2 },
|
||||||
|
["!"] = { "SHELL", colors.color1 },
|
||||||
|
}
|
||||||
|
|
||||||
|
local shortline = false
|
||||||
|
|
||||||
|
-- Initialize the components table
|
||||||
|
local components = {
|
||||||
|
active = {},
|
||||||
|
inactive = {},
|
||||||
|
}
|
||||||
|
|
||||||
|
table.insert(components.active, {}) -- (1) left
|
||||||
|
table.insert(components.active, {}) -- (2) center
|
||||||
|
table.insert(components.active, {}) -- (3) right
|
||||||
|
|
||||||
|
-- global components
|
||||||
|
local invi_sep = {
|
||||||
|
str = " ",
|
||||||
|
hl = {
|
||||||
|
fg = sett.bkg,
|
||||||
|
bg = sett.bkg
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- helpers
|
||||||
|
local function any_git_changes()
|
||||||
|
local gst = b.gitsigns_status_dict -- git stats
|
||||||
|
if gst then
|
||||||
|
if gst["added"] and gst["added"] > 0 or gst["removed"] and gst["removed"] > 0 or gst["changed"] and gst["changed"] > 0 then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- #################### STATUSLINE ->
|
||||||
|
|
||||||
|
|
||||||
|
-- ######## Left
|
||||||
|
|
||||||
|
-- Current vi mode ------>
|
||||||
|
local vi_mode_hl = function()
|
||||||
|
return {
|
||||||
|
fg = sett.bkg,
|
||||||
|
bg = mode_colors[vim.fn.mode()][2],
|
||||||
|
style = "bold"
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
components.active[1][1] = {
|
||||||
|
provider = assets.vertical_bar_chubby,
|
||||||
|
hl = function()
|
||||||
|
return {
|
||||||
|
fg = mode_colors[vim.fn.mode()][2],
|
||||||
|
bg = sett.bkg,
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
components.active[1][2] = {
|
||||||
|
provider = "",
|
||||||
|
hl = function()
|
||||||
|
return {
|
||||||
|
fg = sett.bkg,
|
||||||
|
bg = mode_colors[vim.fn.mode()][2],
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
components.active[1][3] = {
|
||||||
|
provider = function()
|
||||||
|
return " " .. mode_colors[vim.fn.mode()][1] .. " "
|
||||||
|
end,
|
||||||
|
hl = vi_mode_hl,
|
||||||
|
}
|
||||||
|
|
||||||
|
-- there is a dilema: we need to hide Diffs if ther is no git info. We can do that, but this will
|
||||||
|
-- leave the right_semicircle colored with purple, and since we can't change the color conditonally
|
||||||
|
-- then the solution is to create two right_semicircles: one with a color2 sett.bkg and the other one normal
|
||||||
|
-- sett.bkg; both have the same fg (vi mode). The color2 one appears if there is git info, else the one with
|
||||||
|
-- the normal sett.bkg appears. Fixed :)
|
||||||
|
|
||||||
|
-- enable if git diffs are not available
|
||||||
|
components.active[1][4] = {
|
||||||
|
provider = assets.right_semicircle,
|
||||||
|
hl = function()
|
||||||
|
return {
|
||||||
|
fg = mode_colors[vim.fn.mode()][2],
|
||||||
|
bg = sett.bkg
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
enabled = function()
|
||||||
|
return not any_git_changes()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- enable if git diffs are available
|
||||||
|
components.active[1][5] = {
|
||||||
|
provider = assets.right_semicircle,
|
||||||
|
hl = function()
|
||||||
|
return {
|
||||||
|
fg = mode_colors[vim.fn.mode()][2],
|
||||||
|
bg = sett.diffs
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
enabled = function()
|
||||||
|
return any_git_changes()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
-- Current vi mode ------>
|
||||||
|
|
||||||
|
-- Diffs ------>
|
||||||
|
components.active[1][6] = {
|
||||||
|
provider = "git_diff_added",
|
||||||
|
hl = {
|
||||||
|
fg = sett.bkg,
|
||||||
|
bg = sett.diffs,
|
||||||
|
},
|
||||||
|
icon = " ",
|
||||||
|
}
|
||||||
|
|
||||||
|
components.active[1][7] = {
|
||||||
|
provider = "git_diff_changed",
|
||||||
|
hl = {
|
||||||
|
fg = sett.bkg,
|
||||||
|
bg = sett.diffs,
|
||||||
|
},
|
||||||
|
icon = " ",
|
||||||
|
}
|
||||||
|
|
||||||
|
components.active[1][8] = {
|
||||||
|
provider = "git_diff_removed",
|
||||||
|
hl = {
|
||||||
|
fg = sett.bkg,
|
||||||
|
bg = sett.diffs,
|
||||||
|
},
|
||||||
|
icon = " ",
|
||||||
|
}
|
||||||
|
|
||||||
|
components.active[1][9] = {
|
||||||
|
provider = assets.right_semicircle,
|
||||||
|
hl = {
|
||||||
|
fg = sett.diffs,
|
||||||
|
bg = sett.bkg,
|
||||||
|
},
|
||||||
|
enabled = function()
|
||||||
|
return any_git_changes()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
-- Diffs ------>
|
||||||
|
|
||||||
|
-- Extras ------>
|
||||||
|
|
||||||
|
-- file progess
|
||||||
|
components.active[1][10] = {
|
||||||
|
provider = function()
|
||||||
|
local current_line = vim.fn.line(".")
|
||||||
|
local total_line = vim.fn.line("$")
|
||||||
|
|
||||||
|
if current_line == 1 then
|
||||||
|
return " Top "
|
||||||
|
elseif current_line == vim.fn.line("$") then
|
||||||
|
return " Bot "
|
||||||
|
end
|
||||||
|
local result, _ = math.modf((current_line / total_line) * 100)
|
||||||
|
return " " .. result .. "%% "
|
||||||
|
end,
|
||||||
|
-- enabled = shortline or function(winid)
|
||||||
|
-- return vim.api.nvim_win_get_width(winid) > 90
|
||||||
|
-- end,
|
||||||
|
hl = {
|
||||||
|
fg = sett.extras,
|
||||||
|
bg = sett.bkg
|
||||||
|
},
|
||||||
|
left_sep = invi_sep,
|
||||||
|
}
|
||||||
|
|
||||||
|
-- position
|
||||||
|
components.active[1][11] = {
|
||||||
|
provider = "position",
|
||||||
|
-- enabled = shortline or function(winid)
|
||||||
|
-- return vim.api.nvim_win_get_width(winid) > 90
|
||||||
|
-- end,
|
||||||
|
hl = {
|
||||||
|
fg = sett.extras,
|
||||||
|
bg = sett.bkg
|
||||||
|
},
|
||||||
|
left_sep = invi_sep,
|
||||||
|
}
|
||||||
|
-- Extras ------>
|
||||||
|
|
||||||
|
-- ######## Left
|
||||||
|
|
||||||
|
-- ######## Center
|
||||||
|
|
||||||
|
-- Diagnostics ------>
|
||||||
|
-- workspace loader
|
||||||
|
components.active[2][1] = {
|
||||||
|
provider = function()
|
||||||
|
local Lsp = vim.lsp.util.get_progress_messages()[1]
|
||||||
|
|
||||||
|
if Lsp then
|
||||||
|
local msg = Lsp.message or ""
|
||||||
|
local percentage = Lsp.percentage or 0
|
||||||
|
local title = Lsp.title or ""
|
||||||
|
local spinners = {
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
}
|
||||||
|
local success_icon = {
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
}
|
||||||
|
local ms = vim.loop.hrtime() / 1000000
|
||||||
|
local frame = math.floor(ms / 120) % #spinners
|
||||||
|
|
||||||
|
if percentage >= 70 then
|
||||||
|
return string.format(" %%<%s %s %s (%s%%%%) ", success_icon[frame + 1], title, msg, percentage)
|
||||||
|
end
|
||||||
|
|
||||||
|
return string.format(" %%<%s %s %s (%s%%%%) ", spinners[frame + 1], title, msg, percentage)
|
||||||
|
end
|
||||||
|
|
||||||
|
return ""
|
||||||
|
end,
|
||||||
|
enabled = shortline or function(winid)
|
||||||
|
return vim.api.nvim_win_get_width(winid) > 80
|
||||||
|
end,
|
||||||
|
hl = {
|
||||||
|
fg = colors.rosewater,
|
||||||
|
bg = sett.bkg
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
-- genral diagnostics (errors, warnings. info and hints)
|
||||||
|
components.active[2][2] = {
|
||||||
|
provider = "diagnostic_errors",
|
||||||
|
enabled = function()
|
||||||
|
return lsp.diagnostics_exist(lsp_severity.ERROR)
|
||||||
|
end,
|
||||||
|
|
||||||
|
hl = {
|
||||||
|
fg = colors.red,
|
||||||
|
bg = sett.bkg,
|
||||||
|
},
|
||||||
|
icon = " ",
|
||||||
|
}
|
||||||
|
|
||||||
|
components.active[2][3] = {
|
||||||
|
provider = "diagnostic_warnings",
|
||||||
|
enabled = function()
|
||||||
|
return lsp.diagnostics_exist(lsp_severity.WARN)
|
||||||
|
end,
|
||||||
|
hl = {
|
||||||
|
fg = colors.yellow,
|
||||||
|
bg = sett.bkg,
|
||||||
|
},
|
||||||
|
icon = " ",
|
||||||
|
}
|
||||||
|
|
||||||
|
components.active[2][4] = {
|
||||||
|
provider = "diagnostic_info",
|
||||||
|
enabled = function()
|
||||||
|
return lsp.diagnostics_exist(lsp_severity.INFO)
|
||||||
|
end,
|
||||||
|
hl = {
|
||||||
|
fg = colors.sky,
|
||||||
|
bg = sett.bkg,
|
||||||
|
},
|
||||||
|
icon = " ",
|
||||||
|
}
|
||||||
|
|
||||||
|
components.active[2][5] = {
|
||||||
|
provider = "diagnostic_hints",
|
||||||
|
enabled = function()
|
||||||
|
return lsp.diagnostics_exist(lsp_severity.HINT)
|
||||||
|
end,
|
||||||
|
hl = {
|
||||||
|
fg = colors.rosewater,
|
||||||
|
bg = sett.bkg,
|
||||||
|
},
|
||||||
|
icon = " ",
|
||||||
|
}
|
||||||
|
-- Diagnostics ------>
|
||||||
|
|
||||||
|
-- ######## Center
|
||||||
|
|
||||||
|
-- ######## Right
|
||||||
|
|
||||||
|
components.active[3][1] = {
|
||||||
|
provider = "git_branch",
|
||||||
|
enabled = shortline or function(winid)
|
||||||
|
return vim.api.nvim_win_get_width(winid) > 70
|
||||||
|
end,
|
||||||
|
hl = {
|
||||||
|
fg = sett.extras,
|
||||||
|
bg = sett.bkg
|
||||||
|
},
|
||||||
|
icon = " ",
|
||||||
|
left_sep = invi_sep,
|
||||||
|
right_sep = invi_sep,
|
||||||
|
}
|
||||||
|
|
||||||
|
components.active[3][2] = {
|
||||||
|
provider = function()
|
||||||
|
if next(vim.lsp.buf_get_clients()) ~= nil then
|
||||||
|
return " "
|
||||||
|
else
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
hl = {
|
||||||
|
fg = sett.extras,
|
||||||
|
bg = sett.bkg
|
||||||
|
},
|
||||||
|
right_sep = invi_sep,
|
||||||
|
}
|
||||||
|
|
||||||
|
components.active[3][3] = {
|
||||||
|
provider = function()
|
||||||
|
local filename = vim.fn.expand("%:t")
|
||||||
|
local extension = vim.fn.expand("%:e")
|
||||||
|
local icon = require("nvim-web-devicons").get_icon(filename, extension)
|
||||||
|
if icon == nil then
|
||||||
|
icon = " "
|
||||||
|
return icon
|
||||||
|
end
|
||||||
|
return " " .. icon .. " " .. filename .. " "
|
||||||
|
end,
|
||||||
|
enabled = shortline or function(winid)
|
||||||
|
return vim.api.nvim_win_get_width(winid) > 70
|
||||||
|
end,
|
||||||
|
hl = {
|
||||||
|
fg = sett.bkg,
|
||||||
|
bg = sett.curr_file,
|
||||||
|
},
|
||||||
|
left_sep = {
|
||||||
|
str = assets.left_semicircle,
|
||||||
|
hl = {
|
||||||
|
fg = sett.curr_file,
|
||||||
|
bg = sett.bkg,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
components.active[3][4] = {
|
||||||
|
provider = function()
|
||||||
|
local dir_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":t")
|
||||||
|
return " " .. dir_name .. " "
|
||||||
|
end,
|
||||||
|
|
||||||
|
enabled = shortline or function(winid)
|
||||||
|
return vim.api.nvim_win_get_width(winid) > 80
|
||||||
|
end,
|
||||||
|
|
||||||
|
hl = {
|
||||||
|
fg = sett.bkg,
|
||||||
|
bg = sett.curr_dir,
|
||||||
|
},
|
||||||
|
left_sep = {
|
||||||
|
str = assets.left_semicircle,
|
||||||
|
hl = {
|
||||||
|
fg = sett.curr_dir,
|
||||||
|
bg = sett.curr_file,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
-- ######## Right
|
||||||
|
|
||||||
|
return components
|
||||||
11
lua/colorini/highlights.lua
Normal file
11
lua/colorini/highlights.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
local M = {}
|
||||||
|
local config = require('colorini.config')
|
||||||
|
|
||||||
|
function M.highlight_all(colors, base)
|
||||||
|
local base_highlights = config.highlights_base(colors, base)
|
||||||
|
for group, properties in pairs(base_highlights) do
|
||||||
|
vim.api.nvim_set_hl(0, group, properties)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
11
lua/colorini/init.lua
Normal file
11
lua/colorini/init.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
local M = {}
|
||||||
|
local core = require('colorini.core')
|
||||||
|
local highlights = require('colorini.highlights')
|
||||||
|
|
||||||
|
function M.setup(base)
|
||||||
|
local colors = core.get_colors()
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
highlights.highlight_all(colors, base)
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
31
lua/config/lazy.lua
Normal file
31
lua/config/lazy.lua
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
-- 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)
|
||||||
|
|
||||||
|
-- Make sure to setup `mapleader` and `maplocalleader` before
|
||||||
|
-- loading lazy.nvim so that mappings are correct.
|
||||||
|
-- This is also a good place to setup other settings (vim.opt)
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = "\\"
|
||||||
|
|
||||||
|
require("lazy").setup({
|
||||||
|
spec = {
|
||||||
|
-- import plugins
|
||||||
|
{ import = "plugins" },
|
||||||
|
},
|
||||||
|
install = { colorscheme = { "habamax" } },
|
||||||
|
checker = { enabled = false },
|
||||||
|
})
|
||||||
15
lua/plugins/alpha.lua
Normal file
15
lua/plugins/alpha.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
return {
|
||||||
|
"goolord/alpha-nvim",
|
||||||
|
dependencies = {
|
||||||
|
'nvim-tree/nvim-web-devicons',
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local theta = require("alpha.themes.theta")
|
||||||
|
theta.config.layout[1].val = math.floor(vim.fn.winheight(0) * 0.2)
|
||||||
|
theta.header.opts.hl = "Normal"
|
||||||
|
require("alpha").setup(
|
||||||
|
theta.config
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
}
|
||||||
46
lua/plugins/main.lua
Normal file
46
lua/plugins/main.lua
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
return {
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
"Pocco81/auto-save.nvim",
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
{
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
version = "v2.*",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mason-org/mason.nvim",
|
||||||
|
opts={
|
||||||
|
ui = {
|
||||||
|
icons = {
|
||||||
|
package_installed = "✓",
|
||||||
|
package_pending = "➜",
|
||||||
|
package_uninstalled = "✗"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"RRethy/vim-illuminate",
|
||||||
|
{
|
||||||
|
"gelguy/wilder.nvim",
|
||||||
|
opts = function()
|
||||||
|
local wilder = require("wilder")
|
||||||
|
wilder.set_option("renderer", wilder.popupmenu_renderer({
|
||||||
|
pumblend = 20,
|
||||||
|
}))
|
||||||
|
return {
|
||||||
|
modes = { ':', '/', '?' }
|
||||||
|
}
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"zaldih/themery.nvim",
|
||||||
|
lazy = false,
|
||||||
|
config = function()
|
||||||
|
require("themery").setup({
|
||||||
|
themes = vim.fn.getcompletion("", "color"),
|
||||||
|
livePreview = true,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{ "junegunn/vim-easy-align" },
|
||||||
|
{ "sindrets/diffview.nvim" },
|
||||||
|
}
|
||||||
61
lua/plugins/multicursor.lua
Normal file
61
lua/plugins/multicursor.lua
Normal file
|
|
@ -0,0 +1,61 @@
|
||||||
|
return {
|
||||||
|
"jake-stewart/multicursor.nvim",
|
||||||
|
branch = "1.0",
|
||||||
|
config = function()
|
||||||
|
local mc = require("multicursor-nvim")
|
||||||
|
mc.setup()
|
||||||
|
|
||||||
|
local set = vim.keymap.set
|
||||||
|
|
||||||
|
-- Add or skip cursor above/below the main cursor.
|
||||||
|
set({"n", "x"}, "<c-k>", function() mc.lineAddCursor(-1) end)
|
||||||
|
set({"n", "x"}, "<c-j>", function() mc.lineAddCursor(1) end)
|
||||||
|
set({"n", "x"}, "<leader>k", function() mc.lineSkipCursor(-1) end)
|
||||||
|
set({"n", "x"}, "<leader>j", function() mc.lineSkipCursor(1) end)
|
||||||
|
|
||||||
|
-- Add or skip adding a new cursor by matching word/selection
|
||||||
|
set({"n", "x"}, "<leader>n", function() mc.matchAddCursor(1) end)
|
||||||
|
set({"n", "x"}, "<leader>s", function() mc.matchSkipCursor(1) end)
|
||||||
|
set({"n", "x"}, "<leader>N", function() mc.matchAddCursor(-1) end)
|
||||||
|
set({"n", "x"}, "<leader>S", function() mc.matchSkipCursor(-1) end)
|
||||||
|
|
||||||
|
-- Add and remove cursors with control + left click.
|
||||||
|
set("n", "<c-leftmouse>", mc.handleMouse)
|
||||||
|
set("n", "<c-leftdrag>", mc.handleMouseDrag)
|
||||||
|
set("n", "<c-leftrelease>", mc.handleMouseRelease)
|
||||||
|
|
||||||
|
-- Disable and enable cursors.
|
||||||
|
set({"n", "x"}, "<c-q>", mc.toggleCursor)
|
||||||
|
|
||||||
|
-- Mappings defined in a keymap layer only apply when there are
|
||||||
|
-- multiple cursors. This lets you have overlapping mappings.
|
||||||
|
mc.addKeymapLayer(function(layerSet)
|
||||||
|
|
||||||
|
-- Select a different cursor as the main one.
|
||||||
|
layerSet({"n", "x"}, "<left>", mc.prevCursor)
|
||||||
|
layerSet({"n", "x"}, "<right>", mc.nextCursor)
|
||||||
|
|
||||||
|
-- Delete the main cursor.
|
||||||
|
layerSet({"n", "x"}, "<leader>x", mc.deleteCursor)
|
||||||
|
|
||||||
|
-- Enable and clear cursors using escape.
|
||||||
|
layerSet("n", "<esc>", function()
|
||||||
|
if not mc.cursorsEnabled() then
|
||||||
|
mc.enableCursors()
|
||||||
|
else
|
||||||
|
mc.clearCursors()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- Customize how cursors look.
|
||||||
|
local hl = vim.api.nvim_set_hl
|
||||||
|
hl(0, "MultiCursorCursor", { reverse = true })
|
||||||
|
hl(0, "MultiCursorVisual", { link = "Visual" })
|
||||||
|
hl(0, "MultiCursorSign", { link = "SignColumn"})
|
||||||
|
hl(0, "MultiCursorMatchPreview", { link = "Search" })
|
||||||
|
hl(0, "MultiCursorDisabledCursor", { reverse = true })
|
||||||
|
hl(0, "MultiCursorDisabledVisual", { link = "Visual" })
|
||||||
|
hl(0, "MultiCursorDisabledSign", { link = "SignColumn"})
|
||||||
|
end
|
||||||
|
}
|
||||||
60
lua/plugins/nvim-cmp.lua
Normal file
60
lua/plugins/nvim-cmp.lua
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
return {
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
version = false, -- last release is way too old
|
||||||
|
event = "InsertEnter",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
"onsails/lspkind.nvim",
|
||||||
|
},
|
||||||
|
opts = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
local defaults = require("cmp.config.default")()
|
||||||
|
local auto_select = true
|
||||||
|
return {
|
||||||
|
auto_brackets = {},
|
||||||
|
completion = {
|
||||||
|
completeopt = "menu,menuone,noinsert" .. (auto_select and "" or ",noselect"),
|
||||||
|
},
|
||||||
|
preselect = auto_select and cmp.PreselectMode.Item or cmp.PreselectMode.none,
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
|
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||||
|
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
["<CR>"] = cmp.mapping.confirm({ select = auto_select }),
|
||||||
|
["<C-y>"] = cmp.mapping.confirm({ select = true }),
|
||||||
|
["<S-CR>"] = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
|
["<C-CR>"] = function(fallback)
|
||||||
|
cmp.abort()
|
||||||
|
fallback()
|
||||||
|
end,
|
||||||
|
["<tab>"] = function(fallback)
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources(
|
||||||
|
{
|
||||||
|
{ name = "lazydev" },
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "path" },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{ name = "buffer" },
|
||||||
|
{ name = "cmdline" },
|
||||||
|
}
|
||||||
|
),
|
||||||
|
sorting = defaults.sorting,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
22
lua/plugins/oil.lua
Normal file
22
lua/plugins/oil.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
return {
|
||||||
|
'stevearc/oil.nvim',
|
||||||
|
opts = {
|
||||||
|
float = {
|
||||||
|
max_width = 80,
|
||||||
|
max_height = 20,
|
||||||
|
border = "rounded",
|
||||||
|
},
|
||||||
|
preview_win = {
|
||||||
|
update_on_cursor_moved = true,
|
||||||
|
preview_method = "fast_scratch",
|
||||||
|
},
|
||||||
|
delete_to_trash = true,
|
||||||
|
watch_for_changes = true,
|
||||||
|
},
|
||||||
|
dependencies = { { "echasnovski/mini.icons", opts = {} } },
|
||||||
|
lazy = false,
|
||||||
|
keys = {
|
||||||
|
{ "<leader>do", "<cmd>Oil --float<CR>", desc = "Open floating Oil" },
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
26
lua/plugins/telescope.lua
Normal file
26
lua/plugins/telescope.lua
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
return {
|
||||||
|
'nvim-telescope/telescope.nvim',
|
||||||
|
version = false,
|
||||||
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
|
opts = {
|
||||||
|
defaults = {
|
||||||
|
path_display = { "smart" },
|
||||||
|
},
|
||||||
|
pickers = {
|
||||||
|
buffers = {
|
||||||
|
path_display = "short",
|
||||||
|
sort_mru = true,
|
||||||
|
ignore_current_buffer = true,
|
||||||
|
previewer = false,
|
||||||
|
layout_config = {
|
||||||
|
width = 80,
|
||||||
|
height = 10,
|
||||||
|
prompt_position = "top",
|
||||||
|
},
|
||||||
|
prompt_title = false,
|
||||||
|
results_title = false,
|
||||||
|
preview_title = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
15
lua/plugins/toggleterm.lua
Normal file
15
lua/plugins/toggleterm.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
return {
|
||||||
|
"akinsho/toggleterm.nvim",
|
||||||
|
version = "*",
|
||||||
|
opts = {
|
||||||
|
direction = "float",
|
||||||
|
open_mapping = [[<c-\>]],
|
||||||
|
float_opts = {
|
||||||
|
border = "curved",
|
||||||
|
width = 80,
|
||||||
|
height = 20,
|
||||||
|
},
|
||||||
|
hide_numbers = true,
|
||||||
|
},
|
||||||
|
config = true,
|
||||||
|
}
|
||||||
14
lua/plugins/treesitter.lua
Normal file
14
lua/plugins/treesitter.lua
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
return {
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
lazy = false,
|
||||||
|
branch = 'main',
|
||||||
|
build = ':TSUpdate',
|
||||||
|
opts = {
|
||||||
|
ensure_installed = { "lua", "vim", "json" },
|
||||||
|
highlight = { enable = true },
|
||||||
|
indent = { enable = true },
|
||||||
|
config = function(_, opts)
|
||||||
|
require("nvim-treesitter.configs").setup(opts)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
62
lua/testing/lualine.lua
Normal file
62
lua/testing/lualine.lua
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
--[[
|
||||||
|
return {
|
||||||
|
'nvim-lualine/lualine.nvim',
|
||||||
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||||
|
config = function()
|
||||||
|
-- local molokai = require "lualine.themes.molokai"
|
||||||
|
-- molokai.normal.c.bg = "#0A0A0A"
|
||||||
|
-- molokai.normal.c.fg = "#FD971F"
|
||||||
|
local colors = { fg = "#FFFFFF", bg = "#000000" }
|
||||||
|
|
||||||
|
local theme = {
|
||||||
|
normal = { a = colors, b = colors, c = colors },
|
||||||
|
insert = { a = colors, b = colors, c = colors },
|
||||||
|
visual = { a = colors, b = colors, c = colors },
|
||||||
|
}
|
||||||
|
require("lualine").setup({
|
||||||
|
options = {
|
||||||
|
-- icons_enabled = true,
|
||||||
|
icons_enabled = false,
|
||||||
|
theme = theme,
|
||||||
|
-- theme = molokai,
|
||||||
|
-- component_separators = { left = '', right = ''},
|
||||||
|
-- section_separators = { left = '', right = ''},
|
||||||
|
disabled_filetypes = {
|
||||||
|
statusline = {},
|
||||||
|
winbar = {},
|
||||||
|
},
|
||||||
|
ignore_focus = {},
|
||||||
|
always_divide_middle = true,
|
||||||
|
globalstatus = false,
|
||||||
|
refresh = {
|
||||||
|
statusline = 1000,
|
||||||
|
tabline = 1000,
|
||||||
|
winbar = 1000,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
lualine_a = {'mode'},
|
||||||
|
lualine_b = {},
|
||||||
|
-- lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||||
|
lualine_c = { 'filename', },
|
||||||
|
lualine_x = { 'searchcount', 'selectioncount', 'filetype', },
|
||||||
|
lualine_y = {},
|
||||||
|
-- lualine_y = {'progress'},
|
||||||
|
lualine_z = {'location'}
|
||||||
|
},
|
||||||
|
inactive_sections = {
|
||||||
|
lualine_a = {},
|
||||||
|
lualine_b = {},
|
||||||
|
lualine_c = {'filename'},
|
||||||
|
lualine_x = {'location'},
|
||||||
|
lualine_y = {},
|
||||||
|
lualine_z = {}
|
||||||
|
},
|
||||||
|
tabline = {},
|
||||||
|
winbar = {},
|
||||||
|
inactive_winbar = {},
|
||||||
|
extensions = {}
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
]]--
|
||||||
Loading…
Add table
Add a link
Reference in a new issue