mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 14:12:41 +00:00
Initial commit
This commit is contained in:
15
nvim/.config/nvim/init.lua
Normal file
15
nvim/.config/nvim/init.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
-- Plugins
|
||||
require('plugins')
|
||||
|
||||
-- Key maps
|
||||
require('keymaps')
|
||||
|
||||
-- Common settings
|
||||
require('settings')
|
||||
|
||||
-- Auto commands
|
||||
require('autocmd')
|
||||
|
||||
-- Theme
|
||||
require('theme')
|
||||
|
||||
15
nvim/.config/nvim/lua/autocmd.lua
Normal file
15
nvim/.config/nvim/lua/autocmd.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
-- Remove all trailing whitespace on save
|
||||
vim.api.nvim_exec([[
|
||||
augroup TrimWhiteSpace
|
||||
au!
|
||||
autocmd BufWritePre * :%s/\s\+$//e
|
||||
augroup END
|
||||
]], false)
|
||||
|
||||
-- Prevent new line to also start with a comment
|
||||
vim.api.nvim_exec([[
|
||||
augroup NewLineComment
|
||||
au!
|
||||
au FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
|
||||
augroup END
|
||||
]], false)
|
||||
15
nvim/.config/nvim/lua/config/colorizer.lua
Normal file
15
nvim/.config/nvim/lua/config/colorizer.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
require'colorizer'.setup()
|
||||
local status_ok, colorizer = pcall(require, "colorizer")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
colorizer.setup({ "*" }, {
|
||||
RGB = true, -- #RGB hex codes
|
||||
RRGGBB = true, -- #RRGGBB hex codes
|
||||
RRGGBBAA = true, -- #RRGGBBAA hex codes
|
||||
rgb_fn = true, -- CSS rgb() and rgba() functions
|
||||
hsl_fn = true, -- CSS hsl() and hsla() functions
|
||||
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
||||
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
||||
namess = true, -- "Name" codes like Blue
|
||||
})
|
||||
114
nvim/.config/nvim/lua/config/lualine.lua
Normal file
114
nvim/.config/nvim/lua/config/lualine.lua
Normal file
@@ -0,0 +1,114 @@
|
||||
local colors = {
|
||||
red = '#ca1243',
|
||||
grey = '#a0a1a7',
|
||||
black = '#383a42',
|
||||
white = '#f3f3f3',
|
||||
light_green = '#83a598',
|
||||
orange = '#fe8019',
|
||||
green = '#8ec07c',
|
||||
}
|
||||
|
||||
local empty = require('lualine.component'):extend()
|
||||
function empty:draw(default_highlight)
|
||||
self.status = ''
|
||||
self.applied_separator = ''
|
||||
self:apply_highlights(default_highlight)
|
||||
self:apply_section_separators()
|
||||
return self.status
|
||||
end
|
||||
|
||||
-- Put proper separators and gaps between components in sections
|
||||
local function process_sections(sections)
|
||||
for name, section in pairs(sections) do
|
||||
local left = name:sub(9, 10) < 'x'
|
||||
for pos = 1, name ~= 'lualine_z' and #section or #section - 1 do
|
||||
table.insert(section, pos * 2, { empty, color = { fg = colors.white, bg = colors.white } })
|
||||
end
|
||||
for id, comp in ipairs(section) do
|
||||
if type(comp) ~= 'table' then
|
||||
comp = { comp }
|
||||
section[id] = comp
|
||||
end
|
||||
comp.separator = left and { right = '' } or { left = '' }
|
||||
end
|
||||
end
|
||||
return sections
|
||||
end
|
||||
|
||||
local function search_result()
|
||||
if vim.v.hlsearch == 0 then
|
||||
return ''
|
||||
end
|
||||
local last_search = vim.fn.getreg '/'
|
||||
if not last_search or last_search == '' then
|
||||
return ''
|
||||
end
|
||||
local searchcount = vim.fn.searchcount { maxcount = 9999 }
|
||||
return last_search .. '(' .. searchcount.current .. '/' .. searchcount.total .. ')'
|
||||
end
|
||||
|
||||
local function modified()
|
||||
if vim.bo.modified then
|
||||
return '+'
|
||||
elseif vim.bo.modifiable == false or vim.bo.readonly == true then
|
||||
return '-'
|
||||
end
|
||||
return ''
|
||||
end
|
||||
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
theme = 'auto',
|
||||
component_separators = '',
|
||||
section_separators = { left = '', right = '' },
|
||||
},
|
||||
sections = process_sections {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = {
|
||||
'branch',
|
||||
'diff',
|
||||
{
|
||||
'diagnostics',
|
||||
source = { 'nvim' },
|
||||
sections = { 'error' },
|
||||
diagnostics_color = { error = { bg = colors.red, fg = colors.white } },
|
||||
},
|
||||
{
|
||||
'diagnostics',
|
||||
source = { 'nvim' },
|
||||
sections = { 'warn' },
|
||||
diagnostics_color = { warn = { bg = colors.orange, fg = colors.white } },
|
||||
},
|
||||
{ 'filename', file_status = false, path = 1 },
|
||||
{ modified, color = { bg = colors.red } },
|
||||
{
|
||||
'%w',
|
||||
cond = function()
|
||||
return vim.wo.previewwindow
|
||||
end,
|
||||
},
|
||||
{
|
||||
'%r',
|
||||
cond = function()
|
||||
return vim.bo.readonly
|
||||
end,
|
||||
},
|
||||
{
|
||||
'%q',
|
||||
cond = function()
|
||||
return vim.bo.buftype == 'quickfix'
|
||||
end,
|
||||
},
|
||||
},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = { search_result, 'filetype' },
|
||||
lualine_z = { '%l:%c', '%p%%/%L' },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_c = { '%f %y %m' },
|
||||
lualine_x = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {"nvim-tree"}
|
||||
}
|
||||
26
nvim/.config/nvim/lua/config/nightfox.lua
Normal file
26
nvim/.config/nvim/lua/config/nightfox.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
local nightfox = require('nightfox')
|
||||
|
||||
-- This function set the configuration of nightfox. If a value is not passed in the setup function
|
||||
-- it will be taken from the default configuration above
|
||||
nightfox.setup({
|
||||
fox = "nordfox", -- change the colorscheme to use nordfox
|
||||
styles = {
|
||||
comments = "italic", -- change style of comments to be italic
|
||||
keywords = "bold", -- change style of keywords to be bold
|
||||
functions = "italic,bold" -- styles can be a comma separated list
|
||||
},
|
||||
inverse = {
|
||||
match_paren = true, -- inverse the highlighting of match_parens
|
||||
},
|
||||
colors = {
|
||||
red = "#FF000", -- Override the red color for MAX POWER
|
||||
bg_alt = "#000000",
|
||||
},
|
||||
hlgroups = {
|
||||
TSPunctDelimiter = { fg = "${red}" }, -- Override a highlight group with the color red
|
||||
LspCodeLens = { bg = "#000000", style = "italic" },
|
||||
}
|
||||
})
|
||||
|
||||
-- Load the configuration set above and apply the colorscheme
|
||||
nightfox.load()
|
||||
133
nvim/.config/nvim/lua/config/nvim-tree.lua
Normal file
133
nvim/.config/nvim/lua/config/nvim-tree.lua
Normal file
@@ -0,0 +1,133 @@
|
||||
local g = vim.g
|
||||
|
||||
g.nvim_tree_indent_markers = 1 -- 0 by default, this option shows indent markers when folders are open
|
||||
g.nvim_tree_git_hl = 1 -- 0 by default, will enable file highlight for git attributes (can be used without the icons).
|
||||
g.nvim_tree_highlight_opened_files = 1 -- 0 by default, will enable folder and file icon highlight for opened files/directories.
|
||||
g.nvim_tree_root_folder_modifier = ":~" -- This is the default. See :help filename-modifiers for more options
|
||||
g.nvim_tree_add_trailing = 1 -- 0 by default, append a trailing slash to folder names
|
||||
g.nvim_tree_group_empty = 1 -- 0 by default, compact folders that only contain a single folder into one node in the file tree
|
||||
g.nvim_tree_disable_window_picker = 1 -- 0 by default, will disable the window picker.
|
||||
g.nvim_tree_icon_padding = " " -- one space by default, used for rendering the space between the icon and the filename. Use with caution, it could break rendering if you set an empty string depending on your font.
|
||||
g.nvim_tree_symlink_arrow = " >> " -- defaults to ' ➛ '. used as a separator between symlinks' source and target.
|
||||
g.nvim_tree_respect_buf_cwd = 1 -- 0 by default, will change cwd of nvim-tree to that of new buffer's when opening nvim-tree.
|
||||
|
||||
g.nvim_tree_show_icons = {git = 1, folders = 1, files = 1, folder_arrows = 1}
|
||||
g.nvim_tree_icons = {
|
||||
default = "",
|
||||
symlink = "",
|
||||
git = {
|
||||
unstaged = "",
|
||||
staged = "S",
|
||||
unmerged = "",
|
||||
renamed = "➜",
|
||||
deleted = "",
|
||||
untracked = "U",
|
||||
ignored = "◌"
|
||||
},
|
||||
folder = {
|
||||
default = "",
|
||||
open = "",
|
||||
empty = "",
|
||||
empty_open = "",
|
||||
symlink = ""
|
||||
}
|
||||
}
|
||||
local tree_cb = require"nvim-tree.config".nvim_tree_callback
|
||||
require("nvim-tree").setup {
|
||||
-- disables netrw completely
|
||||
disable_netrw = true,
|
||||
-- hijack netrw window on startup
|
||||
hijack_netrw = true,
|
||||
-- open the tree when running this setup function
|
||||
open_on_setup = false,
|
||||
-- will not open on setup if the filetype is in this list
|
||||
ignore_ft_on_setup = {},
|
||||
-- closes neovim automatically when the tree is the last **WINDOW** in the view
|
||||
auto_close = true,
|
||||
-- opens the tree when changing/opening a new tab if the tree wasn't previously opened
|
||||
open_on_tab = true,
|
||||
-- hijack the cursor in the tree to put it at the start of the filename
|
||||
hijack_cursor = true,
|
||||
-- updates the root directory of the tree on `DirChanged` (when your run `:cd` usually)
|
||||
update_cwd = true,
|
||||
-- this option hides files and folders starting with a dot `.`
|
||||
hide_dotfiles = true,
|
||||
-- show lsp diagnostics in the signcolumn
|
||||
diagnostics = {
|
||||
enabled = true,
|
||||
icon = {hint = "", info = "", warning = "", error = ""}
|
||||
},
|
||||
git = {ignore = true},
|
||||
-- update the focused file on `BufEnter`, un-collapses the folders recursively until it finds the file
|
||||
update_focused_file = {
|
||||
-- enables the feature
|
||||
enable = true,
|
||||
-- update the root directory of the tree to the one of the folder containing the file if the file is not under the current root directory
|
||||
-- only relevant when `update_focused_file.enable` is true
|
||||
update_cwd = true,
|
||||
-- list of buffer names / filetypes that will not update the cwd if the file isn't found under the current root directory
|
||||
-- only relevant when `update_focused_file.update_cwd` is true and `update_focused_file.enable` is true
|
||||
ignore_list = {".git", "node_modules", ".cache"}
|
||||
},
|
||||
-- configuration options for the system open command (`s` in the tree by default)
|
||||
system_open = {
|
||||
-- the command to run this, leaving nil should work in most cases
|
||||
cmd = nil,
|
||||
-- the command arguments as a list
|
||||
args = {}
|
||||
},
|
||||
|
||||
trash = {cmd = "trash-put"},
|
||||
|
||||
view = {
|
||||
-- show line numbers in tree disabled
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
-- width of the window, can be either a number (columns) or a string in `%`
|
||||
width = 30,
|
||||
-- side of the tree, can be one of 'left' | 'right' | 'top' | 'bottom'
|
||||
side = "left",
|
||||
-- if true the tree will resize itself after opening a file
|
||||
auto_resize = false,
|
||||
mappings = {
|
||||
-- custom only false will merge the list with the default mappings
|
||||
-- if true, it will only use your list to set the mappings
|
||||
custom_only = true,
|
||||
-- list of mappings to set on the tree manually
|
||||
list = {
|
||||
{key = {"<CR>", "o", "<2-LeftMouse>"}, cb = tree_cb("edit")},
|
||||
{key = {"<2-RightMouse>", "<C-]>"}, cb = tree_cb("cd")},
|
||||
{key = "<C-v>", cb = tree_cb("vsplit")},
|
||||
{key = "<C-x>", cb = tree_cb("split")},
|
||||
{key = "<C-t>", cb = tree_cb("tabnew")},
|
||||
{key = "<", cb = tree_cb("prev_sibling")},
|
||||
{key = ">", cb = tree_cb("next_sibling")},
|
||||
{key = "P", cb = tree_cb("parent_node")},
|
||||
{key = "<BS>", cb = tree_cb("close_node")},
|
||||
{key = "<S-CR>", cb = tree_cb("close_node")},
|
||||
{key = "<Tab>", cb = tree_cb("preview")},
|
||||
{key = "K", cb = tree_cb("first_sibling")},
|
||||
{key = "J", cb = tree_cb("last_sibling")},
|
||||
{key = "I", cb = tree_cb("toggle_ignored")},
|
||||
{key = "H", cb = tree_cb("toggle_dotfiles")},
|
||||
{key = "R", cb = tree_cb("refresh")},
|
||||
{key = "a", cb = tree_cb("create")},
|
||||
{key = "d", cb = tree_cb("remove")},
|
||||
{key = "r", cb = tree_cb("rename")},
|
||||
{key = "<C-r>", cb = tree_cb("full_rename")},
|
||||
{key = "x", cb = tree_cb("cut")},
|
||||
{key = "c", cb = tree_cb("copy")},
|
||||
{key = "p", cb = tree_cb("paste")},
|
||||
{key = "y", cb = tree_cb("copy_name")},
|
||||
{key = "Y", cb = tree_cb("copy_path")},
|
||||
{key = "gy", cb = tree_cb("copy_absolute_path")},
|
||||
{key = "[c", cb = tree_cb("prev_git_item")},
|
||||
{key = "]c", cb = tree_cb("next_git_item")},
|
||||
{key = "-", cb = tree_cb("dir_up")},
|
||||
{key = "s", cb = tree_cb("system_open")},
|
||||
{key = "q", cb = tree_cb("close")},
|
||||
{key = "g?", cb = tree_cb("toggle_help")}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
65
nvim/.config/nvim/lua/config/telescope.lua
Normal file
65
nvim/.config/nvim/lua/config/telescope.lua
Normal file
@@ -0,0 +1,65 @@
|
||||
local actions = require('telescope.actions')
|
||||
local telescope = require('telescope')
|
||||
|
||||
--telescope.load_extension('projects')
|
||||
|
||||
telescope.setup{
|
||||
defaults = {
|
||||
file_ignore_patterns = {"node_modules", "%.jpg", "%.png"},
|
||||
vimgrep_arguments = {
|
||||
'rg',
|
||||
'--follow',
|
||||
'--color=never',
|
||||
'--no-heading',
|
||||
'--with-filename',
|
||||
'--line-number',
|
||||
'--column',
|
||||
'--smart-case'
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
-- Close on first esc instead of gonig to normal mode
|
||||
["<esc>"] = actions.close,
|
||||
["<A-q>"] = actions.send_selected_to_qflist,
|
||||
["<C-q>"] = actions.send_to_qflist,
|
||||
["<s-tab>"] = actions.toggle_selection + actions.move_selection_next,
|
||||
["<tab>"] = actions.toggle_selection + actions.move_selection_previous,
|
||||
},
|
||||
n = {
|
||||
["<s-tab>"] = actions.toggle_selection + actions.move_selection_next,
|
||||
["<tab>"] = actions.toggle_selection + actions.move_selection_previous,
|
||||
["<A-q>"] = actions.send_selected_to_qflist,
|
||||
["<C-q>"] = actions.send_to_qflist,
|
||||
},
|
||||
},
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
entry_prefix = " ",
|
||||
initial_mode = "insert",
|
||||
selection_strategy = "reset",
|
||||
sorting_strategy = "descending",
|
||||
layout_strategy = "flex",
|
||||
layout_config = {
|
||||
width = 0.75,
|
||||
prompt_position = "bottom",
|
||||
preview_cutoff = 120,
|
||||
horizontal = { mirror = false },
|
||||
vertical = { mirror = true },
|
||||
},
|
||||
file_sorter = require'telescope.sorters'.get_fuzzy_file,
|
||||
generic_sorter = require'telescope.sorters'.get_generic_fuzzy_sorter,
|
||||
-- path_display = true, -- strange behaviour not showing the files in result window
|
||||
winblend = 0,
|
||||
border = {},
|
||||
borderchars = { '─', '│', '─', '│', '╭', '╮', '╯', '╰' },
|
||||
color_devicons = true,
|
||||
use_less = true,
|
||||
set_env = { ['COLORTERM'] = 'truecolor' }, -- default = nil,
|
||||
file_previewer = require'telescope.previewers'.vim_buffer_cat.new,
|
||||
grep_previewer = require'telescope.previewers'.vim_buffer_vimgrep.new,
|
||||
qflist_previewer = require'telescope.previewers'.vim_buffer_qflist.new,
|
||||
|
||||
-- Developer configurations: Not meant for general override
|
||||
buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker
|
||||
}
|
||||
}
|
||||
47
nvim/.config/nvim/lua/config/treesitter.lua
Normal file
47
nvim/.config/nvim/lua/config/treesitter.lua
Normal file
@@ -0,0 +1,47 @@
|
||||
require"nvim-treesitter.configs".setup {
|
||||
ensure_installed = {
|
||||
"bash", "cmake", "dockerfile", "go", "hcl", "html", "java",
|
||||
"javascript", "json", "latex", "ledger", "lua", "python", "toml", "yaml"
|
||||
}, -- one of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||
ignore_install = {}, -- List of parsers to ignore installing
|
||||
highlight = {
|
||||
enable = true, -- false will disable the whole extension
|
||||
disable = {} -- list of language that will be disabled
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<CR>",
|
||||
scope_incremental = "<CR>",
|
||||
node_incremental = "<TAB>",
|
||||
node_decremental = "<S-TAB>"
|
||||
}
|
||||
},
|
||||
indent = {enable = true},
|
||||
autopairs = {{enable = true}},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
["al"] = "@loop.outer",
|
||||
["il"] = "@loop.inner",
|
||||
["ib"] = "@block.inner",
|
||||
["ab"] = "@block.outer",
|
||||
["ir"] = "@parameter.inner",
|
||||
["ar"] = "@parameter.outer"
|
||||
}
|
||||
}
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
|
||||
max_file_lines = 2000 -- Do not enable for files with more than specified lines
|
||||
}
|
||||
}
|
||||
121
nvim/.config/nvim/lua/config/which.lua
Normal file
121
nvim/.config/nvim/lua/config/which.lua
Normal file
@@ -0,0 +1,121 @@
|
||||
-- disable v
|
||||
-- local presets = require("which-key.plugins.presets")
|
||||
-- presets.operators["v"] = nil
|
||||
require("which-key").setup {
|
||||
plugins = {
|
||||
marks = true, -- shows a list of your marks on ' and `
|
||||
registers = true, -- shows your registers on " in NORMAL or <C-r> in INSERT mode
|
||||
spelling = {
|
||||
enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
|
||||
suggestions = 20 -- how many suggestions should be shown in the list?
|
||||
},
|
||||
-- the presets plugin, adds help for a bunch of default keybindings in Neovim
|
||||
-- No actual key bindings are created
|
||||
presets = {
|
||||
operators = true, -- adds help for operators like d, y, ... and registers them for motion / text object completion
|
||||
motions = true, -- adds help for motions
|
||||
text_objects = true, -- help for text objects triggered after entering an operator
|
||||
windows = true, -- default bindings on <c-w>
|
||||
nav = true, -- misc bindings to work with windows
|
||||
z = true, -- bindings for folds, spelling and others prefixed with z
|
||||
g = true -- bindings for prefixed with g
|
||||
}
|
||||
},
|
||||
-- add operators that will trigger motion and text object completion
|
||||
-- to enable all native operators, set the preset / operators plugin above
|
||||
operators = {gc = "Comments"},
|
||||
key_labels = {
|
||||
-- override the label used to display some keys. It doesn't effect WK in any other way.
|
||||
-- For example:
|
||||
-- ["<space>"] = "SPC",
|
||||
-- ["<cr>"] = "RET",
|
||||
-- ["<tab>"] = "TAB",
|
||||
},
|
||||
icons = {
|
||||
breadcrumb = "»", -- symbol used in the command line area that shows your active key combo
|
||||
separator = "➜", -- symbol used between a key and it's label
|
||||
group = "+" -- symbol prepended to a group
|
||||
},
|
||||
window = {
|
||||
border = "none", -- none, single, double, shadow
|
||||
position = "bottom", -- bottom, top
|
||||
margin = {1, 0, 1, 0}, -- extra window margin [top, right, bottom, left]
|
||||
padding = {2, 2, 2, 2} -- extra window padding [top, right, bottom, left]
|
||||
},
|
||||
layout = {
|
||||
height = {min = 4, max = 25}, -- min and max height of the columns
|
||||
width = {min = 20, max = 50}, -- min and max width of the columns
|
||||
spacing = 3, -- spacing between columns
|
||||
align = "left" -- align columns left, center or right
|
||||
},
|
||||
ignore_missing = false, -- enable this to hide mappings for which you didn't specify a label
|
||||
hidden = {
|
||||
"<silent>", "<cmd>", "<Cmd>", "<cr>", "<CR>", "call", "lua", "require",
|
||||
"^:", "^ "
|
||||
}, -- hide mapping boilerplate
|
||||
show_help = true, -- show help message on the command line when the popup is visible
|
||||
triggers = "auto", -- automatically setup triggers
|
||||
-- triggers = {"<leader>"} -- or specify a list manually
|
||||
triggers_blacklist = {
|
||||
-- list of mode / prefixes that should never be hooked by WhichKey
|
||||
-- this is mostly relevant for key maps that start with a native binding
|
||||
-- most people should not need to change this
|
||||
i = {"j", "k"},
|
||||
v = {"j", "k"}
|
||||
}
|
||||
}
|
||||
|
||||
local wk = require("which-key")
|
||||
default_options = {noremap = true, silent = true}
|
||||
|
||||
-- register non leader based mappings
|
||||
--wk.register({ga = {"<Plug>(EasyAlign)", "Align", mode = "x"}})
|
||||
|
||||
-- Register all leader based mappings
|
||||
wk.register({
|
||||
["<Tab>"] = {"<cmd>e#<cr>", "Switch to previously opened buffer"},
|
||||
b = {
|
||||
name = "Buffers",
|
||||
b = {
|
||||
"<cmd>lua require'telescope.builtin'.buffers({ sort_mru = true, ignore_current_buffer = true })<cr>",
|
||||
"Find buffer"
|
||||
}
|
||||
},
|
||||
f = {
|
||||
name = "Files",
|
||||
s = {"<cmd>w<cr>", "Save Buffer"},
|
||||
f = {
|
||||
"<cmd>lua require'telescope.builtin'.find_files({ find_command = {'fd', '--hidden', '--type', 'file', '--follow'}})<cr>",
|
||||
"Find File"
|
||||
},
|
||||
l = {"<cmd>Lf<cr>", "Open LF"},
|
||||
p = {"<cmd>NvimTreeToggle<cr>", "Toogle Tree"},
|
||||
r = {"<cmd>Telescope oldfiles<cr>", "Open Recent File"},
|
||||
T = {"<cmd>NvimTreeFindFile<CR>", "Find in Tree"}
|
||||
},
|
||||
s = {
|
||||
name = "Search",
|
||||
c = {"<cmd>Telescope colorscheme<cr>", "Colorscheme"},
|
||||
h = {"<cmd>Telescope help_tags<cr>", "Find Help"},
|
||||
M = {"<cmd>Telescope man_pages<cr>", "Man Pages"},
|
||||
R = {"<cmd>Telescope registers<cr>", "Registers"},
|
||||
t = {"<cmd>Telescope live_grep<cr>", "Text"},
|
||||
s = {"<cmd>Telescope grep_string<cr>", "Text under cursor"},
|
||||
k = {"<cmd>Telescope keymaps<cr>", "Keymaps"},
|
||||
C = {"<cmd>Telescope commands<cr>", "Commands"},
|
||||
p = {"<cmd>Telescope projects<cr>", "Projects"},
|
||||
P = {
|
||||
"<cmd>lua require('telescope.builtin.internal').colorscheme({enable_preview = true})<cr>",
|
||||
"Colorscheme with Preview"
|
||||
}
|
||||
},
|
||||
w = {
|
||||
name = "Window",
|
||||
q = {"<cmd>:q<cr>", "Close"},
|
||||
s = {"<cmd>:split<cr>", "Horizontal Split"},
|
||||
t = {"<c-w>t", "Move to new tab"},
|
||||
["="] = {"<c-w>=", "Equally size"},
|
||||
v = {"<cmd>:vsplit<cr>", "Verstical Split"},
|
||||
w = {"<c-w>x", "Swap"}
|
||||
},
|
||||
}, {prefix = "<leader>", mode = "n", default_options})
|
||||
28
nvim/.config/nvim/lua/keymaps.lua
Normal file
28
nvim/.config/nvim/lua/keymaps.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
default_options = {noremap = true, silent = true}
|
||||
expr_options = {noremap = true, expr = true, silent = true}
|
||||
|
||||
-- map the leader key
|
||||
--keymap('n', '<Space>', '<NOP>', default_options)
|
||||
vim.g.mapleader = ","
|
||||
|
||||
-- easier escape key mapping
|
||||
keymap('i', 'jk', '<ESC>', default_options)
|
||||
|
||||
keymap('n', '<c-s>', ':w<CR>', default_options)
|
||||
keymap('i', '<c-s>', '<ESC>:w<CR>a', default_options)
|
||||
|
||||
-- buffer focus
|
||||
local opts = { noremap = true }
|
||||
keymap('n', '<c-j>', '<c-w>j', default_options)
|
||||
keymap('n', '<c-h>', '<c-w>h', default_options)
|
||||
keymap('n', '<c-k>', '<c-w>k', default_options)
|
||||
keymap('n', '<c-l>', '<c-w>l', default_options)
|
||||
|
||||
-- refresh config
|
||||
--keymap('n', '<Leader>so', ':so $MYVIMRC<CR>', default_opts)
|
||||
|
||||
--keymap('n', '<C-n>', ':NvimTreeToggle<CR>', default_opts)
|
||||
-- find files
|
||||
--keymap('n', '<Leader>f', ':Telescope find_files<cr>', default_opts)
|
||||
|
||||
63
nvim/.config/nvim/lua/plugins.lua
Normal file
63
nvim/.config/nvim/lua/plugins.lua
Normal file
@@ -0,0 +1,63 @@
|
||||
-- Plugins
|
||||
|
||||
local execute = vim.api.nvim_command
|
||||
local fn = vim.fn
|
||||
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
||||
|
||||
|
||||
-- returns the require for use in `config` parameter of packer's use
|
||||
-- expects the name of the config file
|
||||
function get_config(name)
|
||||
return string.format("require(\"config/%s\")", name)
|
||||
end
|
||||
|
||||
-- Install packer if not available
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
fn.system({
|
||||
"git", "clone", "https://github.com/wbthomason/packer.nvim",
|
||||
install_path
|
||||
})
|
||||
execute "packadd packer.nvim"
|
||||
end
|
||||
|
||||
-- Initialize and configure packer
|
||||
local packer = require("packer")
|
||||
packer.init {
|
||||
enable = true, -- enable profiling via :PackerCompile profile=true
|
||||
threshold = 0 -- the amount in ms that a plugins load time must be over for it to be included in the profile
|
||||
}
|
||||
local use = packer.use
|
||||
packer.reset()
|
||||
|
||||
-- actual plugins list
|
||||
use "wbthomason/packer.nvim"
|
||||
|
||||
use {"kyazdani42/nvim-tree.lua", config = get_config("nvim-tree")}
|
||||
|
||||
use {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
config = get_config("lualine"),
|
||||
requires = {"kyazdani42/nvim-web-devicons", opt = true}
|
||||
}
|
||||
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
config = get_config("telescope"),
|
||||
requires = { {'nvim-lua/plenary.nvim'} }
|
||||
}
|
||||
|
||||
use {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
config = get_config("treesitter"),
|
||||
run = ":TSUpdate"
|
||||
}
|
||||
|
||||
use "nvim-treesitter/nvim-treesitter-textobjects"
|
||||
|
||||
use {"folke/which-key.nvim", event = "VimEnter", config = get_config("which")}
|
||||
|
||||
-- Theme
|
||||
use {
|
||||
'EdenEast/nightfox.nvim',
|
||||
config = get_config("nightfox")
|
||||
}
|
||||
64
nvim/.config/nvim/lua/settings.lua
Normal file
64
nvim/.config/nvim/lua/settings.lua
Normal file
@@ -0,0 +1,64 @@
|
||||
local o = vim.opt
|
||||
local wo = vim.wo
|
||||
local fn = vim.fn
|
||||
|
||||
vim.cmd "filetype indent plugin on"
|
||||
vim.cmd "set inccommand=split"
|
||||
-- o.guicursor = "n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50" -- block in normal and beam cursor in insert mode
|
||||
o.updatetime = 300 -- faster completion
|
||||
o.timeoutlen = 400 -- time to wait for a mapped sequence to complete (in milliseconds)
|
||||
o.ttimeoutlen = 0 -- Time in milliseconds to wait for a key code sequence to complete
|
||||
o.backup = false -- creates a backup file
|
||||
o.swapfile = true -- enable/disable swap file creation
|
||||
o.dir = fn.stdpath("data") .. "/swp" -- swap file directory
|
||||
o.undofile = true -- enable/disable undo file creation
|
||||
o.undodir = fn.stdpath("data") .. "/undodir" -- set undo directory
|
||||
o.history = 500 -- Use the 'history' option to set the number of lines from command mode that are remembered.
|
||||
o.hidden = true -- required to keep multiple buffers and open multiple buffers
|
||||
o.clipboard = "unnamedplus" -- allows neovim to access the system clipboard
|
||||
o.fileencoding = "utf-8" -- the encoding written to a file
|
||||
o.conceallevel = 0 -- so that `` is visible in markdown files
|
||||
o.number = true -- set numbered lines
|
||||
o.relativenumber = true -- set relative numbered lines
|
||||
o.cmdheight = 1 -- space for displaying messages/commands
|
||||
o.showmode = false -- we don't need to see things like -- INSERT -- anymore
|
||||
o.showtabline = 2 -- always show tabs
|
||||
o.laststatus = 2 -- The value of this option influences when the last window will have a status line (2 always)
|
||||
o.smartcase = true -- smart case
|
||||
o.smartindent = true -- make indenting smarter again
|
||||
o.splitbelow = true -- force all horizontal splits to go below current window
|
||||
o.splitright = true -- force all vertical splits to go to the right of current window
|
||||
o.expandtab = true -- convert tabs to spaces
|
||||
o.shiftwidth = 2 -- the number of spaces inserted for each indentation
|
||||
o.tabstop = 2 -- how many columns a tab counts for
|
||||
o.termguicolors = true -- set term gui colors (most terminals support this)
|
||||
o.cursorline = true -- highlight the current line
|
||||
o.scrolloff = 3 -- Minimal number of screen lines to keep above and below the cursor
|
||||
o.sidescrolloff = 5 -- The minimal number of columns to scroll horizontally
|
||||
o.hlsearch = true -- highlight all matches on previous search pattern
|
||||
o.ignorecase = true -- ignore case in search patterns
|
||||
o.foldenable = false -- disable folding; enable with zi
|
||||
o.foldmethod = "expr"
|
||||
o.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
-- o.listchars = "eol:¬,tab:>·,trail:~,extends:>,precedes:<"
|
||||
o.listchars = "eol:¬,tab:>·,trail:~,extends:>,precedes:<,space:␣"
|
||||
o.shortmess = o.shortmess + "c" -- prevent "pattern not found" messages
|
||||
wo.colorcolumn = "99999"
|
||||
o.wildmode = "full"
|
||||
o.lazyredraw = true -- do not redraw screen while running macros
|
||||
o.grepprg = "rg --hidden --vimgrep --smart-case --"
|
||||
o.completeopt = {"menu", "menuone", "noselect", "noinsert"} -- A comma separated list of options for Insert mode completion
|
||||
o.wildignorecase = true -- When set case is ignored when completing file names and directories
|
||||
o.wildignore = [[
|
||||
.git,.hg,.svn
|
||||
*.aux,*.out,*.toc
|
||||
*.o,*.obj,*.exe,*.dll,*.manifest,*.rbc,*.class
|
||||
*.ai,*.bmp,*.gif,*.ico,*.jpg,*.jpeg,*.png,*.psd,*.webp
|
||||
*.avi,*.divx,*.mp4,*.webm,*.mov,*.m2ts,*.mkv,*.vob,*.mpg,*.mpeg
|
||||
*.mp3,*.oga,*.ogg,*.wav,*.flac
|
||||
*.eot,*.otf,*.ttf,*.woff
|
||||
*.doc,*.pdf,*.cbr,*.cbz
|
||||
*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz,*.kgb
|
||||
*.swp,.lock,.DS_Store,._*
|
||||
*/tmp/*,*.so,*.swp,*.zip,**/node_modules/**,**/target/**,**.terraform/**"
|
||||
]]
|
||||
24
nvim/.config/nvim/lua/theme.lua
Normal file
24
nvim/.config/nvim/lua/theme.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
-- Nightfox
|
||||
require('nightfox').load('nordfox')
|
||||
|
||||
-- Tokyo Night
|
||||
-- Example config in Lua
|
||||
--vim.g.tokyonight_style = "storm"
|
||||
--vim.g.tokyonight_italic_functions = true
|
||||
--vim.g.tokyonight_sidebars = { "qf", "vista_kind", "terminal", "packer" }
|
||||
|
||||
-- Change the "hint" color to the "orange" color, and make the "error" color bright red
|
||||
--vim.g.tokyonight_colors = { hint = "orange", error = "#ff0000" }
|
||||
|
||||
-- Load the colorscheme
|
||||
--vim.cmd[[colorscheme tokyonight]]
|
||||
|
||||
-- Nord
|
||||
-- Example config in lua
|
||||
--vim.g.nord_contrast = true
|
||||
--vim.g.nord_borders = false
|
||||
--vim.g.nord_disable_background = false
|
||||
--vim.g.nord_italic = false
|
||||
|
||||
-- Load the colorscheme
|
||||
--require('nord').set()
|
||||
136
nvim/.config/nvim/plugin/packer_compiled.lua
Normal file
136
nvim/.config/nvim/plugin/packer_compiled.lua
Normal file
@@ -0,0 +1,136 @@
|
||||
-- Automatically generated packer.nvim plugin loader code
|
||||
|
||||
if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then
|
||||
vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"')
|
||||
return
|
||||
end
|
||||
|
||||
vim.api.nvim_command('packadd packer.nvim')
|
||||
|
||||
local no_errors, error_msg = pcall(function()
|
||||
|
||||
local time
|
||||
local profile_info
|
||||
local should_profile = false
|
||||
if should_profile then
|
||||
local hrtime = vim.loop.hrtime
|
||||
profile_info = {}
|
||||
time = function(chunk, start)
|
||||
if start then
|
||||
profile_info[chunk] = hrtime()
|
||||
else
|
||||
profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
|
||||
end
|
||||
end
|
||||
else
|
||||
time = function(chunk, start) end
|
||||
end
|
||||
|
||||
local function save_profiles(threshold)
|
||||
local sorted_times = {}
|
||||
for chunk_name, time_taken in pairs(profile_info) do
|
||||
sorted_times[#sorted_times + 1] = {chunk_name, time_taken}
|
||||
end
|
||||
table.sort(sorted_times, function(a, b) return a[2] > b[2] end)
|
||||
local results = {}
|
||||
for i, elem in ipairs(sorted_times) do
|
||||
if not threshold or threshold and elem[2] > threshold then
|
||||
results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
|
||||
end
|
||||
end
|
||||
|
||||
_G._packer = _G._packer or {}
|
||||
_G._packer.profile_output = results
|
||||
end
|
||||
|
||||
time([[Luarocks path setup]], true)
|
||||
local package_path_str = "/Users/michael/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/Users/michael/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/Users/michael/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/Users/michael/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
|
||||
local install_cpath_pattern = "/Users/michael/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so"
|
||||
if not string.find(package.path, package_path_str, 1, true) then
|
||||
package.path = package.path .. ';' .. package_path_str
|
||||
end
|
||||
|
||||
if not string.find(package.cpath, install_cpath_pattern, 1, true) then
|
||||
package.cpath = package.cpath .. ';' .. install_cpath_pattern
|
||||
end
|
||||
|
||||
time([[Luarocks path setup]], false)
|
||||
time([[try_loadstring definition]], true)
|
||||
local function try_loadstring(s, component, name)
|
||||
local success, result = pcall(loadstring(s), name, _G.packer_plugins[name])
|
||||
if not success then
|
||||
vim.schedule(function()
|
||||
vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
|
||||
end)
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
time([[try_loadstring definition]], false)
|
||||
time([[Defining packer_plugins]], true)
|
||||
_G.packer_plugins = {
|
||||
["lualine.nvim"] = {
|
||||
config = { 'require("config/lualine")' },
|
||||
loaded = true,
|
||||
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/lualine.nvim",
|
||||
url = "https://github.com/nvim-lualine/lualine.nvim"
|
||||
},
|
||||
["nightfox.nvim"] = {
|
||||
config = { 'require("config/nightfox")' },
|
||||
loaded = true,
|
||||
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/nightfox.nvim",
|
||||
url = "https://github.com/EdenEast/nightfox.nvim"
|
||||
},
|
||||
["nvim-tree.lua"] = {
|
||||
config = { 'require("config/nvim-tree")' },
|
||||
loaded = true,
|
||||
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
|
||||
url = "https://github.com/kyazdani42/nvim-tree.lua"
|
||||
},
|
||||
["nvim-web-devicons"] = {
|
||||
loaded = true,
|
||||
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
|
||||
url = "https://github.com/kyazdani42/nvim-web-devicons"
|
||||
},
|
||||
["packer.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/packer.nvim",
|
||||
url = "https://github.com/wbthomason/packer.nvim"
|
||||
},
|
||||
["plenary.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/plenary.nvim",
|
||||
url = "https://github.com/nvim-lua/plenary.nvim"
|
||||
},
|
||||
["telescope.nvim"] = {
|
||||
config = { 'require("config/telescope")' },
|
||||
loaded = true,
|
||||
path = "/Users/michael/.local/share/nvim/site/pack/packer/start/telescope.nvim",
|
||||
url = "https://github.com/nvim-telescope/telescope.nvim"
|
||||
}
|
||||
}
|
||||
|
||||
time([[Defining packer_plugins]], false)
|
||||
-- Config for: nvim-tree.lua
|
||||
time([[Config for nvim-tree.lua]], true)
|
||||
require("config/nvim-tree")
|
||||
time([[Config for nvim-tree.lua]], false)
|
||||
-- Config for: nightfox.nvim
|
||||
time([[Config for nightfox.nvim]], true)
|
||||
require("config/nightfox")
|
||||
time([[Config for nightfox.nvim]], false)
|
||||
-- Config for: telescope.nvim
|
||||
time([[Config for telescope.nvim]], true)
|
||||
require("config/telescope")
|
||||
time([[Config for telescope.nvim]], false)
|
||||
-- Config for: lualine.nvim
|
||||
time([[Config for lualine.nvim]], true)
|
||||
require("config/lualine")
|
||||
time([[Config for lualine.nvim]], false)
|
||||
if should_profile then save_profiles() end
|
||||
|
||||
end)
|
||||
|
||||
if not no_errors then
|
||||
vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None')
|
||||
end
|
||||
Reference in New Issue
Block a user