my neovim configuration

initial commit

+3
init.lua
···
+
require "ptero.plugins"
+
require "ptero.keymaps"
+
require "ptero.options"
+9
lazy-lock.json
···
+
{
+
"catppuccin": { "branch": "main", "commit": "3020af75aae098a77737d91ee37c7147c8450d99" },
+
"gitsigns.nvim": { "branch": "main", "commit": "d4f8c01280413919349f5df7daccd0c172143d7c" },
+
"lazy.nvim": { "branch": "main", "commit": "e77be3cf3b01402b86464e1734fb5ead448ce12e" },
+
"nvim-treesitter": { "branch": "master", "commit": "3e316204f8ec8450bbaace69d0bf8fe332633fec" },
+
"plenary.nvim": { "branch": "master", "commit": "9d81624fbcedd3dd43b38d7e13a1e7b3f873d8cd" },
+
"telescope.nvim": { "branch": "master", "commit": "04af51dbfb17c2afa0b8d82b0e842e0638201ca9" },
+
"which-key.nvim": { "branch": "main", "commit": "802219ba26409f325a5575e3b684b6cb054e2cc5" }
+
}
+18
lua/ptero/borders.lua
···
+
local b = {
+
tl = "┌", -- top left
+
tr = "┐", -- top right
+
+
bl = "└", -- bottom left
+
br = "┘", -- bottom right
+
+
v = "│", -- vertical
+
h = "─", -- horizontal
+
+
s = "█", -- scroll
+
}
+
+
return {
+
style = "single",
+
bqf = { b.v, b.v, b.h, b.h, b.tl, b.tr, b.bl, b.br, b.s },
+
telescope = { b.h, b.v, b.h, b.v, b.tl, b.tr, b.br, b.bl },
+
}
+82
lua/ptero/configs/gitsigns.lua
···
+
local ok, gitsigns = pcall(require, "gitsigns")
+
if not ok then
+
return
+
end
+
+
local icons = require("ptero.icons")
+
local border = require("ptero.borders").style
+
+
gitsigns.setup({
+
signs = {
+
add = {
+
hl = "GitSignsAdd",
+
text = icons.ui.BoldLineLeft,
+
numhl = "GitSignsAddNr",
+
linehl = "GitSignsAddLn",
+
},
+
change = {
+
hl = "GitSignsChange",
+
text = icons.ui.BoldLineLeft,
+
numhl = "GitSignsChangeNr",
+
linehl = "GitSignsChangeLn",
+
},
+
delete = {
+
hl = "GitSignsDelete",
+
text = icons.ui.Triangle,
+
numhl = "GitSignsDeleteNr",
+
linehl = "GitSignsDeleteLn",
+
},
+
topdelete = {
+
hl = "GitSignsDelete",
+
text = icons.ui.Triangle,
+
numhl = "GitSignsDeleteNr",
+
linehl = "GitSignsDeleteLn",
+
},
+
changedelete = {
+
hl = "GitSignsChange",
+
text = icons.ui.BoldLineLeft,
+
numhl = "GitSignsChangeNr",
+
linehl = "GitSignsChangeLn",
+
},
+
untracked = {
+
hl = "GitSignsAdd",
+
text = icons.ui.BoldLineDotted,
+
numhl = "GitSignsAddNr",
+
linehl = "GitSignsAddLn",
+
},
+
},
+
signcolumn = true,
+
numhl = false,
+
linehl = false,
+
word_diff = false,
+
watch_gitdir = {
+
interval = 1000,
+
follow_files = true,
+
},
+
attach_to_untracked = true,
+
current_line_blame = false,
+
current_line_blame_opts = {
+
virt_text = true,
+
virt_text_pos = "eol",
+
delay = 1000,
+
ignore_whitespace = false,
+
},
+
current_line_blame_formatter_opts = {
+
relative_time = false,
+
},
+
sign_priority = 6,
+
update_debounce = 100,
+
status_formatter = nil,
+
max_file_length = 50000,
+
preview_config = {
+
border = border,
+
style = "minimal",
+
relative = "cursor",
+
row = 0,
+
col = 1,
+
},
+
yadm = {
+
enable = false,
+
},
+
})
+
+45
lua/ptero/configs/telescope.lua
···
+
local ok, telescope = pcall(require, "telescope")
+
if not ok then
+
return
+
end
+
+
local icons = require("ptero.icons")
+
local border = require("ptero.borders").telescope
+
local actions = require("telescope.actions")
+
+
telescope.setup({
+
defaults = {
+
prompt_prefix = icons.ui.Telescope .. " ",
+
selection_caret = icons.ui.Forward .. " ",
+
borderchars = border,
+
mappings = {
+
i = {
+
["<C-j>"] = actions.move_selection_next,
+
["<C-k>"] = actions.move_selection_previous,
+
["<C-c>"] = actions.close,
+
["<C-n>"] = actions.cycle_history_next,
+
["<C-p>"] = actions.cycle_history_prev,
+
["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
+
},
+
n = {
+
["<esc>"] = actions.close,
+
["<C-j>"] = actions.move_selection_next,
+
["<C-k>"] = actions.move_selection_previous,
+
},
+
},
+
path_display = {
+
"smart"
+
},
+
set_env = { COLORTERM = "truecolor" },
+
},
+
pickers = {
+
},
+
extensions = {
+
fzf = {
+
fuzzy = true,
+
override_generic_sorter = true,
+
override_file_sorter = true,
+
case_mode = "smart_case",
+
},
+
},
+
})
+19
lua/ptero/configs/treesitter.lua
···
+
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
+
if not status_ok then
+
return
+
end
+
+
configs.setup {
+
ensure_installed = "all",
+
highlight = {
+
enable = true,
+
additional_vim_regex_highlighting = false,
+
},
+
indent = {
+
enable = true,
+
disable = {
+
"python"
+
}
+
},
+
}
+
+147
lua/ptero/icons.lua
···
+
return {
+
kind = {
+
Text = "",
+
Method = "",
+
Function = "",
+
Constructor = "",
+
Field = "ﰠ",
+
Variable = "",
+
Class = "ﴯ",
+
Interface = "",
+
Module = "",
+
Property = "ﰠ",
+
Unit = "塞",
+
Value = "",
+
Enum = "",
+
Keyword = "",
+
Snippet = "",
+
Color = "",
+
File = "",
+
Reference = "",
+
Folder = "",
+
EnumMember = "",
+
Constant = "",
+
Struct = "פּ",
+
Event = "",
+
Operator = "",
+
TypeParameter = "",
+
},
+
git = {
+
LineAdded = "+",
+
LineModified = "~",
+
LineRemoved = "!",
+
FileDeleted = "!",
+
FileIgnored = "◌",
+
FileRenamed = "➜",
+
FileStaged = "S",
+
FileUnmerged = "u",
+
FileUnstaged = "f",
+
FileUntracked = "U",
+
Diff = "d",
+
Repo = "r",
+
Octoface = "",
+
Branch = "",
+
},
+
ui = {
+
ArrowCircleDown = "",
+
ArrowCircleLeft = "",
+
ArrowCircleRight = "",
+
ArrowCircleUp = "",
+
BoldArrowDown = "",
+
BoldArrowLeft = "",
+
BoldArrowRight = "",
+
BoldArrowUp = "",
+
BoldClose = "",
+
BoldDividerLeft = "",
+
BoldDividerRight = "",
+
BoldLineDotted = "┇",
+
BoldLineLeft = "▎",
+
BookMark = "",
+
BoxChecked = "",
+
Bug = "",
+
Stacks = " ",
+
Scopes = "",
+
Watches = "",
+
DebugConsole = " ",
+
Calendar = "",
+
Check = "",
+
ChevronRight = ">",
+
ChevronShortDown = "",
+
ChevronShortLeft = "",
+
ChevronShortRight = "",
+
ChevronShortUp = "",
+
Circle = "",
+
Close = "",
+
CloudDownload = "",
+
Code = "",
+
Comment = "",
+
Dashboard = "",
+
DividerLeft = "",
+
DividerRight = "",
+
DoubleChevronRight = "»",
+
Ellipsis = "…",
+
EmptyFolder = "",
+
EmptyFolderOpen = "",
+
File = "",
+
FileSymlink = "",
+
Files = "",
+
FindFile = "",
+
FindText = "",
+
Fire = "",
+
Folder = "",
+
FolderOpen = "",
+
FolderSymlink = "",
+
Forward = "",
+
Gear = "",
+
History = "",
+
Lightbulb = "",
+
LineDotted = "┆",
+
LineLeft = "▏",
+
LineMiddle = "│",
+
List = "",
+
Lock = "",
+
NewFile = "",
+
Note = "",
+
Package = "",
+
Pencil = "",
+
Plus = "",
+
Project = "",
+
Search = "",
+
SignIn = "",
+
SignOut = "",
+
Tab = "",
+
Table = "",
+
Target = "",
+
Telescope = "🔭",
+
Text = "",
+
Tree = "",
+
Triangle = "契",
+
TriangleShortArrowDown = "",
+
TriangleShortArrowLeft = "",
+
TriangleShortArrowRight = "",
+
TriangleShortArrowUp = "",
+
},
+
diagnostics = {
+
BoldError = "",
+
Error = "",
+
BoldWarning = "",
+
Warning = "",
+
BoldInformation = "",
+
Information = "",
+
BoldQuestion = "",
+
Question = "",
+
BoldHint = "",
+
Hint = "",
+
Debug = "",
+
Trace = "✎",
+
},
+
misc = {
+
Robot = "ﮧ",
+
Squirrel = "",
+
Tag = "",
+
Watch = "",
+
Smiley = "ﲃ",
+
Package = "",
+
CircuitBoard = "",
+
},
+
}
+23
lua/ptero/keymaps.lua
···
+
local opts = { noremap = true, silent = true}
+
+
local term_opts = { silent = true}
+
+
vim.keymap.set("", "<Space>", "<Nop>", opts)
+
vim.g.mapleader = " "
+
vim.g.maplocalleader = " "
+
+
-- Open netrw in side tree viewer
+
vim.keymap.set("n", "<leader>e", ":Lex 30<cr>", opts)
+
+
-- stay in indent mode when shifting text
+
vim.keymap.set("v", "<", "<gv", opts)
+
vim.keymap.set("v", ">", ">gv", opts)
+
+
-- vim tabs
+
vim.keymap.set("n", "<Tab>", ":tabnext<cr>", opts)
+
vim.keymap.set("n", "<S-Tab>", ":tabprevious<cr>", opts)
+
+
-- telescope
+
vim.keymap.set("n", "<leader>sf", require('telescope.builtin').find_files, opts)
+
vim.keymap.set("n", "<leader>st", require('telescope.builtin').live_grep, opts)
+
vim.keymap.set("n", "<leader>fm", require('telescope.builtin').man_pages, opts)
+17
lua/ptero/options.lua
···
+
local colorscheme = "catppuccin"
+
+
local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
+
if not status_ok then
+
vim.notify("colorscheme " .. colorscheme .. " not found")
+
return
+
end
+
+
require(colorscheme).setup({
+
flavour = "mocha",
+
transparent_background = true,
+
integrations = {
+
gitsigns=true,
+
treesitter=true,
+
which_key=true,
+
},
+
})
+40
lua/ptero/plugins.lua
···
+
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
+
if not vim.loop.fs_stat(lazypath) then
+
vim.fn.system({
+
"git",
+
"clone",
+
"--filter=blob:none",
+
"https://github.com/folke/lazy.nvim.git",
+
"--branch=stable", -- latest stable release
+
lazypath,
+
})
+
end
+
vim.opt.rtp:prepend(lazypath)
+
+
require("lazy").setup({
+
"nvim-lua/plenary.nvim",
+
+
-- color scheme
+
{"catppuccin/nvim", name="catppuccin"},
+
+
-- pretty colors for viewing code
+
{
+
"nvim-treesitter/nvim-treesitter",
+
build=":TSUpdate",
+
config=function() require("ptero.configs.treesitter") end
+
},
+
+
-- fuzzy find all the things
+
{
+
"nvim-telescope/telescope.nvim",
+
config=function() require("ptero.configs.telescope") end
+
},
+
+
-- git signs in the side
+
{
+
"lewis6991/gitsigns.nvim",
+
config=function() require("ptero.configs.gitsigns") end
+
},
+
+
"folke/which-key.nvim"
+
})