update dots

This commit is contained in:
Javier 2024-04-07 11:09:31 -05:00
parent 0495461ae3
commit e705e3dce9
29 changed files with 2210 additions and 212 deletions

View File

@ -49,13 +49,14 @@ decoration {
animations {
enabled = yes
bezier = myBezier, 0.05, 0.9, 0.1, 1.05
animation = windows, 1, 7, myBezier
animation = windowsOut, 1, 7, default, popin 80%
animation = border, 1, 10, default
animation = borderangle, 1, 8, default
animation = fade, 1, 7, default
animation = workspaces, 1, 6, default
# bezier = myBezier, 0.05, 0.9, 0.1, 1.05
# animation = windows, 1, 7, myBezier
# animation = windowsOut, 1, 7, default, popin 80%
# animation = border, 1, 10, default
# animation = borderangle, 1, 8, default
# animation = fade, 1, 7, default
# animation = workspaces, 1, 6, default
animation=windows,1,8,default,popin 20%
}
dwindle {

2
.config/nvim/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
lazy-lock.json
.stylua.toml

View File

@ -0,0 +1,41 @@
local colors_name = "jpbones"
vim.g.colors_name = colors_name -- Required when defining a colorscheme
local lush = require "lush"
local hsluv = lush.hsluv -- Human-friendly hsl
local util = require "zenbones.util"
local bg = vim.o.background
-- Define a palette. Use `palette_extend` to fill unspecified colors
-- Based on https://github.com/gruvbox-community/gruvbox#palette
local palette
palette = util.palette_extend({
bg = hsluv "#000000",
fg = hsluv "#ebdbb2",
rose = hsluv "#e3716e",
leaf = hsluv "#8bae68",
wood = hsluv "#f0e4cf",
water = hsluv "#83a598",
blossom = hsluv "#b279a7",
sky = hsluv "#819b69",
}, bg)
-- Generate the lush specs using the generator util
local generator = require "zenbones.specs"
local base_specs = generator.generate(palette, bg, generator.get_global_config(colors_name, bg))
-- Optionally extend specs using Lush
local specs = lush.extends({ base_specs }).with(function()
return {
Statement { base_specs.Statement, fg = palette.rose },
Special { fg = palette.water },
Type { fg = palette.sky, gui = "italic" },
}
end)
-- Pass the specs to lush to apply
lush(specs)
-- Optionally set term colors
require("zenbones.term").apply_colors(palette)

View File

@ -0,0 +1,319 @@
/*
* github like style
* https://github.com/iamcco/markdown.css/blob/master/dest/github/markdown.css
*/
:root {
--color-text-primary: #333;
--color-text-tertiary: #777;
--color-text-link: #4078c0;
--color-bg-primary: #fff;
--color-bg-secondary: #fafbfc;
--color-bg-tertiary: #f8f8f8;
--color-border-primary: #ddd;
--color-border-secondary: #eaecef;
--color-border-tertiary: #d1d5da;
--color-kbd-foreground: #444d56;
--color-markdown-blockquote-border: #dfe2e5;
--color-markdown-table-border: #dfe2e5;
--color-markdown-table-tr-border: #c6cbd1;
--color-markdown-code-bg: #1b1f230d;
}
[data-theme="dark"] {
--color-text-primary: #c9d1d9;
--color-text-tertiary: #8b949e;
--color-text-link: #58a6ff;
--color-bg-primary: #0d1117;
--color-bg-secondary: #0d1117;
--color-bg-tertiary: #161b22;
--color-border-primary: #30363d;
--color-border-secondary: #21262d;
--color-border-tertiary: #6e7681;
--color-kbd-foreground: #b1bac4;
--color-markdown-blockquote-border: #3b434b;
--color-markdown-table-border: #3b434b;
--color-markdown-table-tr-border: #272c32;
--color-markdown-code-bg: #f0f6fc26;
}
.markdown-body ol ol,
.markdown-body ul ol,
.markdown-body ol ul,
.markdown-body ul ul,
.markdown-body ol ul ol,
.markdown-body ul ul ol,
.markdown-body ol ul ul,
.markdown-body ul ul ul {
margin-top: 0;
margin-bottom: 0;
}
.markdown-body {
font-family: "MonoLisa","Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans,
sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 12px;
color: var(--color-text-primary);
line-height: 1.6;
word-wrap: break-word;
padding: 45px;
background: var(--color-bg-primary);
}
.markdown-body > *:first-child {
margin-top: 0 !important;
}
.markdown-body > *:last-child {
margin-bottom: 0 !important;
}
.markdown-body .table-of-contents ol {
list-style: none;
}
.markdown-body .table-of-contents > ol {
padding-left: 0;
}
.markdown-body * {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
margin-top: 1em;
margin-bottom: 16px;
font-weight: bold;
line-height: 1.4;
}
.markdown-body h1 .anchor,
.markdown-body h2 .anchor,
.markdown-body h3 .anchor,
.markdown-body h4 .anchor,
.markdown-body h5 .anchor,
.markdown-body h6 .anchor {
margin-left: -24px;
visibility: hidden;
}
.markdown-body h1:hover .anchor,
.markdown-body h2:hover .anchor,
.markdown-body h3:hover .anchor,
.markdown-body h4:hover .anchor,
.markdown-body h5:hover .anchor,
.markdown-body h6:hover .anchor {
visibility: visible;
}
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}
.markdown-body h1 {
margin: 0.67em 0;
padding-bottom: 0.3em;
font-size: 2.25em;
line-height: 1.2;
border-bottom: 1px solid var(--color-border-secondary);
}
.markdown-body h2 {
padding-bottom: 0.3em;
font-size: 1.75em;
line-height: 1.225;
border-bottom: 1px solid var(--color-border-secondary);
}
.markdown-body h3 {
font-size: 1.5em;
line-height: 1.43;
}
.markdown-body h4 {
font-size: 1.25em;
}
.markdown-body h5 {
font-size: 1em;
}
.markdown-body h6 {
font-size: 1em;
color: var(--color-text-tertiary);
}
.markdown-body hr {
margin-top: 20px;
margin-bottom: 20px;
height: 0;
border: 0;
border-top: 1px solid var(--color-border-primary);
}
.markdown-body ol,
.markdown-body ul {
padding-left: 2em;
}
.markdown-body ol ol,
.markdown-body ul ol {
list-style-type: lower-roman;
}
.markdown-body ol ul,
.markdown-body ul ul {
list-style-type: circle;
}
.markdown-body ol ul ul,
.markdown-body ul ul ul {
list-style-type: square;
}
.markdown-body ol {
list-style-type: decimal;
}
.markdown-body ul {
list-style-type: disc;
}
.markdown-body dl {
margin-bottom: 1.3em;
}
.markdown-body dl dt {
font-weight: 700;
}
.markdown-body dl dd {
margin-left: 0;
}
.markdown-body dl dd p {
margin-bottom: 0.8em;
}
.markdown-body blockquote {
margin-left: 0;
margin-right: 0;
padding: 0 15px;
color: var(--color-text-tertiary);
border-left: 4px solid var(--color-markdown-blockquote-border);
}
.markdown-body table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
word-break: keep-all;
border-collapse: collapse;
border-spacing: 0;
}
.markdown-body table tr {
background-color: var(--color-bg-primary);
border-top: 1px solid var(--color-markdown-table-tr-border);
}
.markdown-body table tr:nth-child(2n) {
background-color: var(--color-bg-tertiary);
}
.markdown-body table th,
.markdown-body table td {
padding: 6px 13px;
border: 3px solid var(--color-markdown-table-border);
vertical-align: top;
}
.markdown-body kbd {
display: inline-block;
padding: 5px 6px;
font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
line-height: 10px;
color: var(--color-kbd-foreground);
vertical-align: middle;
background-color: var(--color-bg-secondary);
border: 1px solid var(--color-border-tertiary);
border-radius: 3px;
box-shadow: inset 0 -1px 0 var(--color-border-tertiary);
}
.markdown-body pre {
word-wrap: normal;
padding: 16px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: var(--color-bg-tertiary);
-webkit-border-radius: 3px;
border-radius: 3px;
}
.markdown-body pre code {
display: inline;
max-width: initial;
padding: 0;
margin: 0;
overflow: initial;
font-size: 100%;
line-height: inherit;
word-wrap: normal;
white-space: pre;
border: 0;
-webkit-border-radius: 3px;
border-radius: 3px;
background-color: transparent;
}
.markdown-body pre code:before,
.markdown-body pre code:after {
content: normal;
}
.markdown-body code {
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
padding: 0;
padding-top: 0.2em;
padding-bottom: 0.2em;
margin: 0;
font-size: 85%;
background-color: var(--color-markdown-code-bg);
-webkit-border-radius: 3px;
border-radius: 3px;
}
.markdown-body code:before,
.markdown-body code:after {
letter-spacing: -0.2em;
content: "\00a0";
}
.markdown-body a {
color: var(--color-text-link);
text-decoration: none;
background: transparent;
}
.markdown-body img {
max-width: 100%;
max-height: 100%;
padding: 1rem;
}
.markdown-body strong {
font-weight: bold;
}
.markdown-body em {
font-style: italic;
}
.markdown-body del {
text-decoration: line-through;
}
.task-list-item {
list-style-type: none;
}
.task-list-item input {
font: 13px/1.4 Helvetica, arial, nimbussansl, liberationsans, freesans, clean,
sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
margin: 0 0.35em 0.25em -1.6em;
vertical-align: middle;
}
.task-list-item input[disabled] {
cursor: default;
}
.task-list-item input[type="checkbox"] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
}
.task-list-item input[type="radio"] {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h4 {
clear: both;
}
#page-header {
display: none;
}

566
.config/nvim/init.lua Normal file
View File

@ -0,0 +1,566 @@
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
vim.opt.cmdheight = 0
local is_windows = package.config:sub(1, 1) == '\\'
if is_windows then
vim.api.nvim_command('language en_US')
end
-- Install package manager
-- https://github.com/folke/lazy.nvim
-- `:help lazy.nvim.txt` for more info
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)
-- NOTE: Here is where you install your plugins.
-- You can configure plugins using the `config` key.
--
-- You can also configure plugins after the setup call,
-- as they will be available in your neovim runtime.
require('lazy').setup({
-- NOTE: First, some plugins that don't require any configuration
-- Git related plugins
'tpope/vim-fugitive',
'tpope/vim-rhubarb',
-- Detect tabstop and shiftwidth automatically
'tpope/vim-sleuth',
-- NOTE: This is where your plugins related to LSP can be installed.
-- The configuration is done below. Search for lspconfig to find it below.
{
-- LSP Configuration & Plugins
'neovim/nvim-lspconfig',
dependencies = {
-- Automatically install LSPs to stdpath for neovim
{ 'williamboman/mason.nvim', config = true },
'williamboman/mason-lspconfig.nvim',
-- Useful status updates for LSP
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
{ 'j-hui/fidget.nvim', branch = "legacy", opts = { text = { spinner = "dots_negative", }, } },
-- Additional lua configuration, makes nvim stuff amazing!
'folke/neodev.nvim',
},
},
{
-- Autocompletion
'hrsh7th/nvim-cmp',
dependencies = {
-- Snippet Engine & its associated nvim-cmp source
'L3MON4D3/LuaSnip',
'saadparwaiz1/cmp_luasnip',
'hrsh7th/cmp-path',
'hrsh7th/cmp-buffer',
-- Adds LSP completion capabilities
'hrsh7th/cmp-nvim-lsp',
-- Adds a number of user-friendly snippets
'rafamadriz/friendly-snippets',
-- Icons
'onsails/lspkind.nvim',
{
'nvim-tree/nvim-web-devicons',
config = function()
require 'nvim-web-devicons'.get_icons()
end
},
},
},
-- Useful plugin to show you pending keybinds.
{
'folke/which-key.nvim',
opts = {}
},
{
-- Adds git releated signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
opts = {
-- See `:help gitsigns.txt`
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
},
on_attach = function(bufnr)
vim.keymap.set('n', '<leader>gp', require('gitsigns').prev_hunk,
{ buffer = bufnr, desc = '[G]o to [P]revious Hunk' })
vim.keymap.set('n', '<leader>gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' })
vim.keymap.set('n', '<leader>ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' })
end,
},
},
{
-- Set lualine as statusline
'nvim-lualine/lualine.nvim',
-- See `:help lualine.txt`
opts = {
options = {
icons_enabled = true,
component_separators = '|',
section_separators = '',
always_divide_middle = true,
},
sections = {
lualine_a = { 'mode' },
lualine_b = { 'filename' },
-- lualine_c = { 'diagnostics' },
lualine_c = {},
lualine_x = { 'branch', }, --'fileformat', 'filetype' },
lualine_y = { 'progress' },
lualine_z = { 'location' }
},
},
},
{
-- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim',
main = "ibl",
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help indent_blankline.txt`
opts = {},
},
-- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} },
-- Fuzzy Finder (files, lsp, etc)
{
'nvim-telescope/telescope.nvim',
branch = '0.1.x',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
require 'telescope'.setup {
config = {
prompt = "󰘍",
}
}
end
},
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
-- Only load if `make` is available. Make sure you have the system
-- requirements installed.
{
'nvim-telescope/telescope-fzf-native.nvim',
-- NOTE: If you are having trouble with this installation,
-- refer to the README for telescope-fzf-native for more instructions.
build = 'make',
cond = function()
return vim.fn.executable 'make' == 1
end,
},
{
-- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects',
},
build = ':TSUpdate',
indent = { enable = true, },
config = function()
require 'nvim-treesitter.configs'.setup {
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
}
end
},
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
-- These are some example plugins that I've included in the kickstart repository.
-- Uncomment any of the lines below to enable them.
require 'kickstart.plugins.autoformat',
-- require 'kickstart.plugins.debug',
-- NOTE: The import below automatically adds your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping
-- up-to-date with whatever is in the kickstart repo.
--
-- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
{ import = 'custom.plugins' },
}, {})
-- [[ Setting options ]]
-- See `:help vim.o`
-- NOTE: You can change these options as you wish!
-- Set highlight on search
vim.o.hlsearch = false
-- Make line numbers default
vim.wo.number = true
-- Enable mouse mode
vim.o.mouse = 'a'
-- Sync clipboard between OS and Neovim.
-- Remove this option if you want your OS clipboard to remain independent.
-- See `:help 'clipboard'`
vim.o.clipboard = 'unnamedplus'
-- Enable break indent
vim.o.breakindent = true
-- Save undo history
vim.o.undofile = true
-- Case insensitive searching UNLESS /C or capital in search
vim.o.ignorecase = true
vim.o.smartcase = true
-- Keep signcolumn on by default
vim.wo.signcolumn = 'yes'
-- Decrease update time
vim.o.updatetime = 250
vim.o.timeout = true
vim.o.timeoutlen = 300
-- Set completeopt to have a better completion experience
vim.o.completeopt = 'menuone,noselect'
-- NOTE: You should make sure your terminal supports this
vim.o.termguicolors = true
-- [[ Basic Keymaps ]]
-- Keymaps for better default experience
-- See `:help vim.keymap.set()`
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
-- Remap for dealing with word wrap
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
-- [[ Highlight on yank ]]
-- See `:help vim.highlight.on_yank()`
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
vim.api.nvim_create_autocmd('TextYankPost', {
callback = function()
vim.highlight.on_yank()
end,
group = highlight_group,
pattern = '*',
})
-- [[ Configure Telescope ]]
-- See `:help telescope` and `:help telescope.setup()`
require('telescope').setup {
defaults = {
mappings = {
i = {
['<C-u>'] = false,
['<C-d>'] = false,
},
},
},
}
-- Enable telescope fzf native, if installed
pcall(require('telescope').load_extension, 'fzf')
-- See `:help telescope.builtin`
vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' })
vim.keymap.set('n', '<leader>sb', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' })
vim.keymap.set('n', '<leader>/', function()
-- You can pass additional configuration to telescope to change theme, layout, etc.
require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
winblend = 10,
previewer = false,
})
end, { desc = '[/] Fuzzily search in current buffer' })
vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' })
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' })
vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' })
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
-- [[ Configure Treesitter ]]
-- See `:help nvim-treesitter`
require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter
ensure_installed = { 'lua', 'vimdoc', 'vim' },
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false,
highlight = { enable = true },
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<c-space>',
node_incremental = '<c-space>',
scope_incremental = '<c-s>',
node_decremental = '<M-space>',
},
},
textobjects = {
select = {
enable = true,
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = {
-- You can use the capture groups defined in textobjects.scm
['aa'] = '@parameter.outer',
['ia'] = '@parameter.inner',
['af'] = '@function.outer',
['if'] = '@function.inner',
['ac'] = '@class.outer',
['ic'] = '@class.inner',
},
},
move = {
enable = true,
set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = {
[']m'] = '@function.outer',
[']]'] = '@class.outer',
},
goto_next_end = {
[']M'] = '@function.outer',
[']['] = '@class.outer',
},
goto_previous_start = {
['[m'] = '@function.outer',
['[['] = '@class.outer',
},
goto_previous_end = {
['[M'] = '@function.outer',
['[]'] = '@class.outer',
},
},
swap = {
enable = true,
swap_next = {
['<leader>a'] = '@parameter.inner',
},
swap_previous = {
['<leader>A'] = '@parameter.inner',
},
},
},
}
-- Diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
local sign = function(opts)
vim.fn.sign_define(opts.name, {
texthl = opts.name,
text = opts.text,
numhl = ''
})
end
sign({ name = 'DiagnosticSignError', text = '' })
sign({ name = 'DiagnosticSignWarn', text = '' })
sign({ name = 'DiagnosticSignHint', text = '󱦲' })
sign({ name = 'DiagnosticSignInfo', text = '󰙎' })
-- [[ Configure LSP ]]
-- This function gets run when an LSP connects to a particular buffer.
local on_attach = function(_, bufnr)
-- NOTE: Remember that lua is a real programming language, and as such it is possible
-- to define small helper and utility functions so you don't have to repeat yourself
-- many times.
--
-- In this case, we create a function that lets us more easily define mappings specific
-- for LSP related items. It sets the mode, buffer and description for us each time.
local nmap = function(keys, func, desc)
if desc then
desc = 'LSP: ' .. desc
end
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
end
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation')
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
-- See `:help K` for why this keymap
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
-- Lesser used LSP functionality
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
nmap('<leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, '[W]orkspace [L]ist Folders')
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
vim.lsp.buf.format()
end, { desc = 'Format current buffer with LSP' })
end
-- Enable the following language servers
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
--
-- Add any additional override configuration in the following tables. They will be passed to
-- the `settings` field of the server config. You must look up that documentation yourself.
local servers = {
-- clangd = {},
-- gopls = {},
pyright = {},
rust_analyzer = {},
-- tsserver = {},
lua_ls = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
},
}
-- Setup neovim lua configuration
require('neodev').setup()
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
-- Ensure the servers above are installed
local mason_lspconfig = require 'mason-lspconfig'
mason_lspconfig.setup {
ensure_installed = vim.tbl_keys(servers),
}
mason_lspconfig.setup_handlers {
function(server_name)
require('lspconfig')[server_name].setup {
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
}
end,
}
-- [[ Configure nvim-cmp ]]
-- See `:help cmp`
local cmp = require 'cmp'
local lspkind = require('lspkind')
local luasnip = require 'luasnip'
require('luasnip.loaders.from_vscode').lazy_load()
-- load snippets from path/of/your/nvim/config/my-cool-snippets
require("luasnip.loaders.from_snipmate").lazy_load()
luasnip.config.setup {}
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert {
['<C-n>'] = cmp.mapping.select_next_item(),
['<C-p>'] = cmp.mapping.select_prev_item(),
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
-- ['<C-Space>'] = cmp.mapping.complete {},
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
},
sources = {
{ name = 'nvim_lsp', group_index = 1 },
{ name = 'luasnip', group_index = 2 },
{ name = 'path', group_index = 3 },
},
window = {
completion = require('cmp').config.window.bordered({
border = 'rounded',
}),
documentation = require('cmp').config.window.bordered({
border = 'rounded',
}),
},
formatting = {
-- changing the order of fields so the icon is the first
-- fields = { "kind", 'abbr', "menu" },
fields = { "kind", "abbr", "menu" },
view = {
entries = "wildmenu" -- can be "custom", "wildmenu" or "native"
},
--
-- -- here is where the change happens
format = lspkind.cmp_format({
mode = 'symbol', -- show only symbol annotations
menu = ({
nvim_lsp = "[LSP]",
luasnip = "[LuaSnip]",
buffer = "[Buffer]", }),
preset = 'codicons',
}),
}
}
function highlight_neorg_code_block()
local line = vim.fn.getline('.')
local lang = string.match(line, '^@code%s+(%S+)')
print('Detected language:', lang) -- Debug line
if lang then
vim.cmd('setlocal syntax=' .. lang)
end
end
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
require("settings")

View File

@ -0,0 +1,429 @@
-- [[ insert your plugins below ]]
return {
-- [[ Eyecandy & fancy prgramming stuff ]]
{
"mcchrish/zenbones.nvim",
dependencies = "rktjmp/lush.nvim",
priority = 1000,
config = function()
vim.g.jpbones = {
solid_line_nr = true,
darken_comments = 45,
transparent_background = true,
}
vim.cmd [[colorscheme jpbones]]
end
},
--
{
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
},
{ 'tpope/vim-sleuth' }, -- Detect tabstop and shiftwidth automatically
{ 'matze/vim-move' },
{ 'itchyny/calendar.vim' },
{
'windwp/nvim-autopairs',
config = function()
require('nvim-autopairs').setup()
end
},
{ 'tpope/vim-surround' },
{ 'lilydjwg/colorizer' },
{
'stevearc/dressing.nvim',
config = function()
require('dressing').setup()
end
},
{
"yamatsum/nvim-cursorline",
config = function()
require('nvim-cursorline').setup {
cursorline = {
enable = false,
timeout = 1000,
number = false,
},
cursorword = {
enable = true,
min_length = 2,
hl = { underline = true },
}
}
end
},
-- [[ Markdown Preview ]]
-- Preview in browser
{
"iamcco/markdown-preview.nvim",
ft = { "markdown" },
build = "cd app && npm install",
config = function()
vim.g.mkdp_filetypes = { "markdown" }
vim.g.mkdp_page_title = "${name}"
vim.g.mkdp_markdown_css = vim.fn.stdpath("config") .. "/assets/markdown.css"
end,
},
-- Table mode
-- https://github.com/dhruvasagar/vim-table-mode
{
"dhruvasagar/vim-table-mode",
ft = { "markdown", "norg", "org" },
config = function()
-- Bug: changing prefix doesn't work https://github.com/dhruvasagar/vim-table-mode/issues/222
-- :h table-mode-mappings
-- For Markdown-compatible tables use
vim.g.table_mode_map_prefix = "<localleader>t"
vim.g.table_mode_corner = "+"
vim.g.table_mode_header_fillchar = '='
-- vim.cmd("let g:table_mode_map_prefix = '<localleader>t'")
-- vim.g.toggle_mode_options_toggle_map = "<localleader>tm"
-- vim.g.table_mode_commands_tableize = "<localleader>tt"
end,
},
-- -- [[ notes ]]
-- {
-- "nvim-neorg/neorg",
-- build = ":Neorg sync-parsers",
-- cmd = "Neorg",
-- dependencies = {
-- "nvim-lua/plenary.nvim",
-- 'jubnzv/mdeval.nvim',
-- 'nvim-neorg/neorg-telescope',
-- "laher/neorg-exec",
-- { "pysan3/neorg-templates", dependencies = { "L3MON4D3/LuaSnip" } },
-- },
-- config = function()
-- require("telescope").load_extension("neorg")
-- require("neorg").setup {
-- load = {
-- ["external.templates"] = {
-- config = {
-- templates_dir = vim.fn.stdpath("config") .. "/templates/norg",
-- },
-- },
-- ["core.defaults"] = {}, -- Loads default behaviour
-- ["core.neorgcmd"] = {},
-- ["core.completion"] = { config = { engine = "nvim-cmp", name = "[Norg]" } },
-- ["core.looking-glass"] = {},
-- ["core.integrations.telescope"] = {},
-- ["core.keybinds"] = {
-- config = {
-- -- neorg_leader = "<leader><leader>",
-- hook = function(keybinds)
-- keybinds.map("norg", "n", "ngj", "<Cmd>Neorg journal today<CR>")
-- keybinds.map("norg", "n", "njo", "<Cmd>Neorg journal toc open<CR>")
-- keybinds.map("norg", "n", "njO", "<Cmd>Neorg journal toc update<CR>")
-- keybinds.map("norg", "n", "np", "<Cmd>Neorg presenter start<CR>")
-- keybinds.map("norg", "n", "nt", "<Cmd>Neorg tangle current-file<CR>")
-- keybinds.map("norg", "n", "nwn", "<Cmd>Neorg workspace notes<CR>")
-- keybinds.map("norg", "n", "nww", "<Cmd>Neorg workspace work<CR>")
-- keybinds.remap_event("norg", "i", "<C-f>", "core.integrations.telescope.insert_link")
-- keybinds.remap_event("norg", "n", "ge", "core.looking-glass.magnify-code-block")
-- keybinds.remap_event("norg", "n", "<C-s>", "core.integrations.telescope.find_linkable")
-- end,
-- },
-- },
-- ["core.concealer"] = {
-- config = {
-- folds = true,
-- icon_present = "varided",
-- icons = {
-- heading = {
-- icons = { "⁖", "⁖", "⁖", "⁖", "⁖", "⁖", },
-- },
-- todo = {
-- cancelled = {
-- icon = "_",
-- },
-- done = {
-- icon = "x",
-- },
-- on_hold = {
-- icon = "-",
-- },
-- recurring = {
-- icon = "+",
-- },
-- uncertain = {
-- icon = "?",
-- },
-- pending = {
-- icon = "-",
-- },
-- undone = {
-- icon = " ",
-- },
-- urgent = {
-- icon = "!",
-- },
-- },
-- },
-- },
-- }, -- Adds pretty icons to your documents
-- ["core.highlights"] = {
-- config = {
-- } -- highlights here
-- },
-- ["core.tempus"] = {},
-- ["core.ui.calendar"] = {},
-- ["core.export.markdown"] = {},
-- ["core.export"] = {},
-- ["core.manoeuvre"] = {},
-- ["core.summary"] = {},
-- ["core.syntax"] = {},
-- ["core.promo"] = {},
-- ["core.journal"] = {
-- config = {
-- strategy = "nested",
-- },
-- },
-- ["core.ui"] = {},
-- ["core.tangle"] = {},
-- ["core.presenter"] = { config = { zen_mode = "zen-mode" } },
-- ["core.queries.native"] = {},
-- ["core.qol.todo_items"] = {
-- config = {
-- create_todo_parents = true,
-- },
-- },
-- ["core.qol.toc"] = {
-- config = {
-- close_after_use = true,
-- },
-- },
-- ["core.esupports.metagen"] = { config = { type = "empty", update_date = true } },
-- ["core.esupports.hop"] = {},
-- ["core.dirman"] = { -- Manages Neorg workspaces
-- config = {
-- workspaces = {
-- notes = "~/notes",
-- work = "~/notes/work",
-- },
-- default_workspace = "work",
-- },
-- },
-- ["external.exec"] = {},
-- },
-- }
-- vim.api.nvim_set_hl(0, "@neorg.tags.ranged_verbatim.code_block", { bg = "#333333" })
-- end,
-- },
{
'jakewvincent/mkdnflow.nvim',
rocks = 'luautf8', -- Ensures optional luautf8 dependency is installed
dependencies = { 'ekickx/clipboard-image.nvim',
"mzlogin/vim-markdown-toc" },
config = function()
require('mkdnflow').setup({
links = {
style = 'markdown',
name_is_source = false,
conceal = false,
context = 0,
implicit_extension = nil,
transform_implicit = false,
transform_explicit = function(text)
text = text:gsub(" ", "-")
text = text:lower()
text = os.date('%Y-%m-%d_') .. text
return (text)
end
},
tables = {
trim_whitespace = true,
format_on_move = true,
auto_extend_rows = false,
auto_extend_cols = false,
},
mappings = {
-- MkdnFollowLink = { { 'n', 'v' }, '<leader>fl' }, -- see MkdnEnter
MkdnToggleToDo = { { 'n', 'v' }, '<Space>to' },
MkdnNewListItem = { { 'n', 'v' }, '<leader>li' },
},
})
end,
},
-- [[ Zen mode ]]
{
'folke/zen-mode.nvim',
dependencies = { 'folke/twilight.nvim' },
config = function()
require("zen-mode").setup({
window = {
width = .75, -- width will be 85% of the editor width
options = {
number = false,
relativenumber = false,
},
}
})
end,
},
{
'akinsho/toggleterm.nvim',
version = "*",
config = function()
local status_ok, toggleterm = pcall(require, "toggleterm")
if not status_ok then
return
end
toggleterm.setup({
-- size = 25,
size = function(term)
if term.direction == "horizontal" then
return 17
elseif term.direction == "vertical" then
return vim.o.columns * 0.4
end
end,
open_mapping = [[<C-\>]],
hide_numbers = true,
shade_filetypes = {},
shade_terminals = true,
shading_factor = 2,
start_in_insert = true,
insert_mappings = false,
persist_size = true,
direction = "float",
-- direction = "horizontal",
close_on_exit = true,
shell = vim.o.shell,
float_opts = {
width = math.min(math.ceil(vim.fn.winwidth(0) * 0.8), 120),
height = math.min(math.ceil(vim.fn.winheight(0) * 0.8), 28),
border = "curved",
winblend = 0,
highlights = {
border = "Normal",
background = "Normal",
},
},
})
local opts = { height = math.floor(vim.fn.winheight(0) * 0.85) }
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true, float_opts = opts })
-- :Lazygit
vim.api.nvim_create_user_command("LazyGit", function()
lazygit:toggle()
end, {})
vim.api.nvim_set_keymap("n", "<leader>lg", ":LazyGit<cr>", { noremap = true, silent = true })
function _G.set_terminal_keymaps()
local opts = { buffer = 0 }
vim.keymap.set("t", "<esc>", [[<C-\><C-n>]], opts)
vim.keymap.set("t", "jk", [[<C-\><C-n>]], opts)
vim.keymap.set("t", "<C-h>", [[<Cmd>wincmd h<CR>]], opts)
vim.keymap.set("t", "<C-j>", [[<Cmd>wincmd j<CR>]], opts)
vim.keymap.set("t", "<C-k>", [[<Cmd>wincmd k<CR>]], opts)
vim.keymap.set("t", "<C-;>", [[<Cmd>wincmd l<CR>]], opts)
end
-- if you only want these mappings for toggle term use term://*toggleterm#* instead
-- vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")
vim.cmd("autocmd! TermOpen term://*toggleterm#* lua set_terminal_keymaps()")
end,
},
-- {
-- "nvim-tree/nvim-tree.lua",
-- lazy = true,
-- version = "*",
-- dependencies = {
-- "nvim-tree/nvim-web-devicons",
-- },
-- config = function()
-- require("nvim-tree").setup {}
-- end,
-- },
{
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
config = function()
require("lsp_lines").setup()
end,
},
-- {
-- 'Exafunction/codeium.vim',
-- ft = { "python", "lua", "rust" },
-- config = function()
-- -- Change '<C-g>' here to any keycode you like.
-- vim.keymap.set('i', '<c-a>', function() return vim.fn['codeium#Accept']() end, { expr = true })
-- vim.keymap.set('i', '<c-.>', function() return vim.fn['codeium#CycleCompletions'](1) end, { expr = true })
-- vim.keymap.set('i', '<c-,>', function() return vim.fn['codeium#CycleCompletions'](-1) end, { expr = true })
-- vim.keymap.set('i', '<c-x>', function() return vim.fn['codeium#Clear']() end, { expr = true })
-- end
-- },
{
"michaelb/sniprun",
build = "sh ./install.sh"
},
-- [[ Rust Baby!! ]]
{
'simrat39/rust-tools.nvim',
ft = { "rust" },
config = function()
local rt = require("rust-tools")
local mason_registry = require("mason-registry")
local codelldb = mason_registry.get_package("codelldb")
local extension_path = codelldb:get_install_path() .. "/extension/"
local codelldb_path = extension_path .. "adapter/codelldb"
local liblldb_path = extension_path .. "lldb/lib/liblldb.dylib"
rt.setup({
dap = {
adapter = require("rust-tools.dap").get_codelldb_adapter(codelldb_path, liblldb_path),
},
server = {
capabilities = require("cmp_nvim_lsp").default_capabilities(),
on_attach = function(_, bufnr)
vim.keymap.set("n", "<leader>k", rt.hover_actions.hover_actions, { buffer = bufnr })
vim.keymap.set("n", "<leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
end,
},
tools = {
hover_actions = {
auto_focus = true,
},
},
})
end
},
{
'rust-lang/rust.vim',
ft = "rust",
init = function()
vim.g.rustfmt_autosave = 1
end
},
--
}

View File

@ -0,0 +1,74 @@
-- autoformat.lua
--
-- Use your language server to automatically format your code on save.
-- Adds additional commands as well to manage the behavior
return {
'neovim/nvim-lspconfig',
config = function()
-- Switch for controlling whether you want autoformatting.
-- Use :KickstartFormatToggle to toggle autoformatting on or off
local format_is_enabled = true
vim.api.nvim_create_user_command('KickstartFormatToggle', function()
format_is_enabled = not format_is_enabled
print('Setting autoformatting to: ' .. tostring(format_is_enabled))
end, {})
-- Create an augroup that is used for managing our formatting autocmds.
-- We need one augroup per client to make sure that multiple clients
-- can attach to the same buffer without interfering with each other.
local _augroups = {}
local get_augroup = function(client)
if not _augroups[client.id] then
local group_name = 'kickstart-lsp-format-' .. client.name
local id = vim.api.nvim_create_augroup(group_name, { clear = true })
_augroups[client.id] = id
end
return _augroups[client.id]
end
-- Whenever an LSP attaches to a buffer, we will run this function.
--
-- See `:help LspAttach` for more information about this autocmd event.
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-attach-format', { clear = true }),
-- This is where we attach the autoformatting for reasonable clients
callback = function(args)
local client_id = args.data.client_id
local client = vim.lsp.get_client_by_id(client_id)
local bufnr = args.buf
-- Only attach to clients that support document formatting
if not client.server_capabilities.documentFormattingProvider then
return
end
-- Tsserver usually works poorly. Sorry you work with bad languages
-- You can remove this line if you know what you're doing :)
if client.name == 'tsserver' then
return
end
-- Create an autocmd that will run *before* we save the buffer.
-- Run the formatting command for the LSP that has just attached.
vim.api.nvim_create_autocmd('BufWritePre', {
group = get_augroup(client),
buffer = bufnr,
callback = function()
if not format_is_enabled then
return
end
vim.lsp.buf.format {
async = false,
filter = function(c)
return c.id == client.id
end,
}
end,
})
end,
})
end,
}

View File

@ -0,0 +1,98 @@
-- debug.lua
--
-- Shows how to use the DAP plugin to debug your code.
--
-- Primarily focused on configuring the debugger for Go, but can
-- be extended to other languages as well. That's why it's called
-- kickstart.nvim and not kitchen-sink.nvim ;)
return {
-- NOTE: Yes, you can install new plugins here!
'mfussenegger/nvim-dap',
-- NOTE: And you can specify dependencies as well
dependencies = {
-- Creates a beautiful debugger UI
'rcarriga/nvim-dap-ui',
-- Installs the debug adapters for you
'williamboman/mason.nvim',
'jay-babu/mason-nvim-dap.nvim',
-- Add your own debuggers here
},
config = function()
local dap = require 'dap'
local dapui = require 'dapui'
dap.configurations.cpp = {
{
name = "Launch file",
type = "codelldb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/')
end,
cwd = '${workspaceFolder}',
stopOnEntry = false,
},
}
dap.configurations.c = dap.configurations.cpp
dap.configurations.rust = dap.configurations.cpp
require('mason-nvim-dap').setup {
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_setup = true,
-- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information
handlers = {},
-- You'll need to check that you have the required things installed
-- online, please don't ask me how to install them :)
ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want
'codellb',
},
}
-- Basic debugging keymaps, feel free to change to your liking!
vim.keymap.set('n', '<F5>', dap.continue)
vim.keymap.set('n', '<F1>', dap.step_into)
vim.keymap.set('n', '<F2>', dap.step_over)
vim.keymap.set('n', '<F3>', dap.step_out)
vim.keymap.set('n', '<leader>b', dap.toggle_breakpoint)
vim.keymap.set('n', '<leader>B', function()
dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ')
end)
-- Dap UI setup
-- For more information, see |:help nvim-dap-ui|
dapui.setup {
-- Set icons to characters that are more likely to work in every terminal.
-- Feel free to remove or use ones that you like more! :)
-- Don't feel like these are good choices.
icons = { expanded = '', collapsed = '', current_frame = '*' },
controls = {
icons = {
pause = '',
play = '',
step_into = '',
step_over = '',
step_out = '',
step_back = 'b',
run_last = '▶▶',
terminate = '',
disconnect = "",
},
},
}
-- toggle to see last session result. Without this ,you can't see session output in case of unhandled exception.
vim.keymap.set("n", "<F7>", dapui.toggle)
dap.listeners.after.event_initialized['dapui_config'] = dapui.open
dap.listeners.before.event_terminated['dapui_config'] = dapui.close
dap.listeners.before.event_exited['dapui_config'] = dapui.close
end,
}

View File

@ -0,0 +1,181 @@
-- Personal Configuration keymaps
-- Variables declarations
-- [[ Setting options ]]
-- See `:help vim.o`
-- Set highlight on search
vim.o.hlsearch = false
vim.o.cmdheight = 1
-- Make line numbers default
vim.wo.number = true
vim.wo.relativenumber = true
-- Enable mouse mode
vim.o.mouse = 'a'
-- Enable break indent
vim.o.breakindent = true
-- Save undo history
vim.o.undofile = true
-- Case insensitive searching UNLESS /C or capital in search
vim.o.ignorecase = true
vim.o.smartcase = true
vim.cmd([[highlight clear LineNr]])
vim.cmd([[highlight clear SignColumn]])
vim.cmd([[highlight GitSignsAdd guibg = NONE]])
vim.cmd([[highlight GitSignsChange guibg=NONE]])
vim.cmd([[highlight GitSignsDelete guibg=NONE]])
-- Decrease update time
vim.o.updatetime = 250
vim.wo.signcolumn = 'yes'
vim.opt.showmode = false
local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
local os = vim.loop.os_uname().sysname
vim.keymap.set("n", "<bs>", ":edit #<cr>", { silent = true })
-- Blink cursor:
vim.cmd([[set guicursor+=a:-blinkwait175-blinkoff150-blinkon175]])
vim.cmd([[hi Normal guibg=NONE ctermbg=NONE]])
vim.opt.scrolloff = 5
vim.opt.splitbelow = true
vim.opt.splitright = true
vim.opt.colorcolumn = "81"
vim.opt.clipboard = "unnamedplus"
vim.opt.autochdir = true
vim.opt.showtabline = 1
vim.opt.conceallevel = 2
vim.opt.cursorline = false
-- Do not load tohtml.vim
-- Tabs keys
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.g.rst_syntax_code_list = { "python", "lua" }
vim.g.loaded_2html_plugin = 1
-- Do not load zipPlugin.vim, gzip.vim and tarPlugin.vim (all these plugins are
-- related to checking files inside compressed files)
-- Do not load the tutor plugin
-- Do not use builtin matchit.vim and matchparen.vim since we use vim-matchup
-- Disable sql omni completion, it is broken.
vim.g.loaded_zipPlugin = 1
vim.g.loaded_gzip = 1
vim.g.loaded_tarPlugin = 1
vim.g.loaded_tutor_mode_plugin = 1
vim.g.loaded_matchit = 1
vim.g.loaded_matchparen = 1
vim.g.loaded_sql_completion = 1
-- Keymaps
-- git
map("n", "<leader>gs", ":Telescope git_status<cr>", opts)
map("n", "<leader>gc", ":Telescope git_commits<cr>", opts)
map("n", "<leader>gb", ":Telescope git_branches<cr>", opts)
-- Move windows:
map("n", "<C-h>", "<C-W>h", opts)
map("n", "<C-j>", "<C-W>j", opts)
map("n", "<C-k>", "<C-W>k", opts)
map("n", "<C-l>", "<C-W>l", opts)
-- Move in insert mode like in nirmal mode hjkl:
map("i", "<C-h>", "<Left>", opts)
map("i", "<C-j>", "<Down>", opts)
map("i", "<C-k>", "<Up>", opts)
map("i", "<C-l>", "<Right>", opts)
-- barbar mappings --
-- Move to previous/next
map("n", "<A-,>", ":bprevious<CR>", opts)
map("n", "<A-.>", ":bnext<CR>", opts)
map("n", "<A-q>", ":bd<CR>", opts)
-- documents markdown, pdf & norg files.
map("n", "<leader>pdf", ":silent ! latexpdf % <CR>", opts)
map("n", "<leader>md", ":MarkdownPreview<CR>", opts)
map("n", "<leader>doc",
":silent ! pandoc ./% --pdf-engine=xelatex --template eisvogel -o ./format/pdf/%.pdf<CR>", opts)
map("n", "<leader>ne", ":Neorg export to-file<CR>", opts)
map("n", "<leader>zz", ":ZenMode<CR>", opts)
--
-- [[ nvim Config files ]]
if os == "Windows_NT" then
map("n", "<leader>ecf", ":cd ~/Appdata/Local/nvim/ | Telescope find_files<CR>", opts)
elseif os == "Linux" then
map("n", "<leader>ecf", ":cd ~/.config/nvim/ | Telescope find_files<CR>", opts)
end
map("n", "<C-S>", ":%s/\\<<C-r><C-w>\\>//gI<Left><Left><Left>", opts)
map("v", "<", "<gv", opts)
map("v", ">", ">gv", opts)
map("n", "<M-x>", ":!", opts) -- Meta X like emacs. This is blasphemy....
map("n", "<leder>hrr", ":so%<CR>", opts)
map("i", "jk", "<Esc>l", opts)
map("i", "jj", "<Esc>l", opts)
map("i", "qw", "<Esc>$", opts)
map("n", "cw", "ciw", opts)
map("n", "vw", "viw", opts)
map("n", "<esc>", ":noh<return><esc>", opts)
map("n", "<f12>", ":!python %<CR>", opts)
map("n", "<f9>", ":setlocal spell! spelllang=en<CR>", opts)
map("n", "<f10>", ":setlocal spell! spelllang=es<CR>", opts)
map("i", "<M->>", "<C-x>s", opts)
map("n", "<leader><leader>e", ":Ex<CR>", opts)
map("n", "<leader>ni", ":Neorg index<CR>", opts)
map("n", "<leader>?", ":Telescope oldfiles theme=get_ivy<CR>", opts)
map("n", "<leader>,", ":Telescope buffers theme=get_ivy<CR>", opts)
vim.keymap.set('n', '<localleader>x', ':Neorg exec cursor<CR>', { silent = true })
vim.cmd([[hi tkLink ctermfg=Cyan cterm=bold,underline guifg=blue gui=bold,underline]])
vim.cmd([[hi tkBrackets ctermfg=gray guifg=gray]])
-- Keymaps for better default experience
-- See `:help vim.keymap.set()`
-- vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
-- Remap for dealing with word wrap
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
-- [[ Highlight on yank ]]
-- See `:help vim.highlight.on_yank()`
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
vim.api.nvim_create_autocmd('TextYankPost', {
callback = function()
vim.highlight.on_yank()
end,
group = highlight_group,
pattern = '*',
})
-- [[ LSP diagnositcs ]]
vim.api.nvim_set_keymap('n', '<leader>do', '<cmd>lua vim.diagnostic.open_float()<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>d[', '<cmd>lua vim.diagnostic.goto_prev()<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<leader>d]', '<cmd>lua vim.diagnostic.goto_next()<CR>', { noremap = true, silent = true })
-- The following command requires plug-ins "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim", and optionally "kyazdani42/nvim-web-devicons" for icon support
vim.api.nvim_set_keymap('n', '<leader>dd', '<cmd>Telescope diagnostics<CR>', { noremap = true, silent = true })
-- If you don't want to use the telescope plug-in but still want to see all the errors/warnings, comment out the telescope line and uncomment this:
-- vim.api.nvim_set_keymap('n', '<leader>dd', '<cmd>lua vim.diagnostic.setloclist()<CR>', { noremap = true, silent = true })
vim.keymap.set(
"",
"<Leader>l",
require("lsp_lines").toggle,
{ desc = "Toggle lsp_lines" }
)
-- [[ nvim-tree ]]
map("n", "<C-e>", ":Vexplore<CR>", opts)

View File

@ -0,0 +1,90 @@
-- INI STATUSLINE
-- local util = require('creativenull.utils')
vim.opt.showmode = false
vim.opt.laststatus = 2
local CTRL_v = vim.api.nvim_replace_termcodes('<C-v>', true, true, true)
local CTRL_s = vim.api.nvim_replace_termcodes('<C-s>', true, true, true)
local modes = setmetatable({
["n"] = "[NORMAL]",
["i"] = "[INSERT]",
["R"] = "[REPLACE]",
["v"] = "[VISUAL]",
["V"] = "[V-LINE]",
[CTRL_v] = "[V-BLOCK]",
["c"] = "[COMMAND]",
["s"] = "[SELECT]",
["S"] = "[S-LINE]",
[CTRL_s] = "[S-BLOCK]",
["t"] = "[TERMINAL]",
}, {
__index = function()
return "UNKNOWN "
end
})
function GitBranch()
local cmd = 'git branch --show-current'
local is_dir = util.is_dir(vim.fn.getcwd() .. '/.git')
if not is_dir then
return ''
end
local fp = io.popen(cmd)
local branch = fp:read('*a')
-- TODO:
-- Will need to check if the '^@' chars are at the end
-- instead of implicitly removing the last 2 chars
branch = string.sub(branch, 0, -2)
return branch
end
local get_current_mode = function()
local current_mode = vim.api.nvim_get_mode().mode
return string.format("%s", modes[current_mode])
end
local file_type = function()
local v_ft = vim.bo.filetype
if v_ft == nil or v_ft == "" then
return string.format("%s", "no ft")
else
return string.format("%s", v_ft)
end
end
local file_format = function()
return string.format("%s", vim.bo.fileformat)
end
local file_enc = function()
local v_fenc = vim.bo.fileencoding
if v_fenc == nil or v_fenc == "" then
return string.format("%s", vim.go.encoding)
else
return string.format("%s", v_fenc)
end
end
Statusline = function()
return table.concat {
get_current_mode(),
"%r %t %m",
"%=",
file_format(),
"|",
file_enc(),
"|",
file_type(),
"|",
"%3p%%",
"|",
"%l,%c",
""
}
end
vim.opt.statusline = "%!v:lua.Statusline()"
-- FIN STATUSLINE

View File

@ -0,0 +1,8 @@
# Global Snippets.
snippet #!s
#!/bin/sh
# Created By: Javier Pacheco - jpacheco@cock.li
# Created On: `strftime("%d/%m/%y")`
# Project: ${1:Description of the script}

View File

@ -0,0 +1 @@
extends _

View File

@ -0,0 +1,27 @@
# Markdown
snippet meta "Metadata for markdown files"
---
theme: ~/jp.json
title: ${1:Tittle}
author: ${2:Author}
date: `strftime("%d/%m/%Y")`
---
${0:Start your document...}
# Language.
snippet cb
\`\`\`${1:language}
${2:code}
\`\`\`
# Definition lists
snippet ~ Definition list
$1
: $0
snippet ~~ Alternate definition list
$1
- $0

View File

@ -0,0 +1,14 @@
# My persoal useful snippets.
# [[ Neorg ]]
snippet lk
{:${1:Object}:}[${2:Description}]
snippet lf
{file:///${1:some/path/}:}[${2:Description}]
snippet <s
#tangle ${1:Name of the file...}
@code ${2:Language}
${0:Start coding...}
@end

View File

@ -0,0 +1,20 @@
fixture
contactor
Buhler
seteado
gripper
presspad
cooling
buhler
hub
ManIt
ManIt
ManIt
#azon
razon/!
bisquet
trim
lasermarker
lasermarker
KUKA
PLC

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,19 @@
@document.meta
title: 2023-10-27
description:
authors: francisco.pacheco
categories:
created: 2023-10-27
updated: 2023-10-27T04:48:15-0600
version: 1.0.0
@end
* 2023-10-27
#weather Sunny 
{:2023-10-26:}[Yesterday] - {:2023-10-28:}[Tomorrow]
** Daily Review
-
** Today's Checklist
- ( ) Write my daily review

View File

@ -1,106 +0,0 @@
{
"layer": "top",
"position": "top",
"height": 27,
"modules-left": ["sway/workspaces", "sway/mode"],
"modules-center": ["sway/window"],
"modules-right": ["network", "pulseaudio", "battery", "clock"],
"sway/workspaces": {
"disable-scroll": true,
"disable-markup": true,
"format": "{index}"
},
"sway/window": {
"format": "{}",
"max-length": 150
},
"custom/scratch": {
"interval": 3,
"exec": "swaymsg -t get_tree | jq 'recurse(.nodes[]) | first(select(.name==\"__i3_scratch\")) | .floating_nodes | length | select(. >= 0)'",
"format": "^{}",
"on-click": "swaymsg 'scratchpad show'",
"on-click-right": "swaymsg 'move scratchpad'"
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"tray": {
"icon-size": 18,
"spacing": 15
},
"clock": {
"format": "{:%a %b %e %R}",
"interval": 30
},
"battery": {
"bat": "BAT0",
"states": {
"full": 99,
"good": 98,
"normal": 98,
"warning": 20,
"critical": 20
},
"format": "{icon} {capacity}%",
"format-good": "{icon} {capacity}%",
"format-full": " {capacity}%",
"format-icons": ["", "", "", "", ""],
"interval": 30
},
"network": {
"interface": "wlp4s0",
"format-wifi": " WiFi-On",
"format-disconnected": "睊 Disconnected",
"interval": 60
},
"temperature": {
"thermal-zone": 0,
"format": "{icon} {temperatureC}°C",
"format-icons":[""],
"interval": 30
},
"backlight": {
"device": "intel_backlight",
"format": "{icon} {percent}% ",
"format-icons": ["","","",""],
"interval": 60
},
"pulseaudio": {
"format": "{icon} {volume}% ",
"format-bluetooth": " {volume}% ",
"format-muted":"婢 Mute ",
"interval": 60,
"format-icons": {
"default": [""]
},
"on-click": "blueman-manager"
}
}

View File

@ -1,99 +0,0 @@
* {
font-family: "Iosevka JP";
font-size: 16px;
}
window#waybar {
background-color: #225877;
color: #ffffff;
}
.modules-left {
background-color: #323232;
padding: 0px 0px 0px 0px;
}
.modules-right {
background-color: #323232;
padding: 0px 5px 0px 0px;
}
#custom-scratch {
background-color: #323232;
color: #b8b8b8;
padding: 0px 9px 0px 9px;
}
#workspaces {
}
#workspaces button {
padding: 0px 11px 0px 11px;
min-width: 1px;
color: #888888;
}
#workspaces button.focused {
padding: 0px 11px 0px 11px;
background-color: #285577;
color: #ffffff;
}
#mode {
background-color: #900000;
color: #ffffff;
padding: 0px 5px 0px 5px;
border: 1px solid #2f343a;
}
#window {
color: #ffffff;
background-color: #285577;
padding: 0px 10px 0px 10px;
}
window#waybar.empty #window {
background-color: transparent;
color: transparent;
}
window#waybar.empty {
background-color: #323232;
}
#network, #temperature, #backlight, #pulseudio, #battery {
padding: 0px 15px 0px 15px;
}
#clock {
margin: 0px 15px 0px 15px;
}
#tray{
padding: 0px 8px 0px 5px;
margin: 0px 5px 0px 5px;
}
#battery.critical {
color: #ff5555;
}
#network.disconnected {
color: #ff5555;
}

View File

@ -0,0 +1,8 @@
# [[ Javier Hyprland configuration ]]
source = ~/.config/hypr/src/init.conf
source = ~/.config/hypr/src/general.conf
source = ~/.config/hypr/src/env.conf
source = ~/.config/hypr/src/windowrules.conf
source = ~/.config/hypr/src/keybinds.conf
source = ~/.config/hypr/src/scratchpads.conf

View File

@ -0,0 +1,57 @@
[pyprland]
plugins = [
"scratchpads",
"shortcuts_menu",
"expose"
]
[scratchpads.term]
animation = "fromTop"
command = "foot -a term"
class = "term"
size = "75% 60%"
max_size = "1920px 100%"
margin = 50
[scratchpads.music_player]
animation = "fromRight"
command = "foot -a music_player -e ncmpcpp"
class = "music_player"
size = "75% 60%"
max_size = "1920px 100%"
margin = 50
[scratchpads.nnn]
animation = "fromLeft"
command = "foot -a nnn -e nnn"
class = "nnn"
size = "50% 40%"
position = "5% 10%"
max_size = "1920px 100%"
margin = 50
[scratchpads.fetch]
animation = "fromLeft"
command = "foot -a venom_fetch"
class = "venom_fetch"
size = "23% 48%"
position = "5% 10%"
max_size = "1920px 100%"
margin = 50
[shortcuts_menu]
engine = "fuzzel --dmenu"
# parameters = "-p '[prompt] 🍰 ' -dmenu -matching fuzzy -i"
command_start = "💀"
[shortcuts_menu.entries]
"Restart Waybar" = "pkill -9 waybar ; setsid waybar"
"Telegram" = "xdg-open https://web.telegram.org/a/#-1421253041"
"Cinny" = "xdg-open https://app.cinny.in/"
"Scratch" = [
{name="action", options=["sync", "sysup" ]},
"foot -e doas scratch [action]"
]

View File

@ -0,0 +1,10 @@
# hyprland env's
env = QT_QPA_PLATFORM,wayland
env = HYPRCURSOR_THEME,Breeze_Dark
env = HYPRCURSOR_SIZE,24
# Set variables
monitor=eDP-1,1920x1080@60,0x0,1
$terminal = footclient
$menu = fuzzel_run

View File

@ -0,0 +1,83 @@
general {
gaps_in = 5
gaps_out = 10
border_size = 2
no_border_on_floating = 0
col.active_border = rgba(999999bb)
col.inactive_border = rgba(595959aa)
layout = master
allow_tearing = false
cursor_inactive_timeout = 2
resize_corner = 3
}
input {
kb_layout = gb,us
kb_options=grp:win_space_toggle
kb_variant =
kb_model =
numlock_by_default = true
kb_options = ctrl:nocaps
kb_rules =
follow_mouse = 1
touchpad {
natural_scroll = no
}
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}
decoration {
rounding = 0
blur {
size = 1
passes = 2
new_optimizations = true
xray = false
ignore_opacity = true
}
drop_shadow = no
shadow_range = 4
shadow_render_power = 3
col.shadow = rgba(1a1a1aee)
blurls = waybar
}
animations {
enabled = yes
# bezier = myBezier, 0.05, 0.9, 0.1, 1.05
# animation = windows, 1, 7, myBezier
# animation = windowsOut, 1, 7, default, popin 80%
# animation = border, 1, 10, default
# animation = borderangle, 1, 8, default
# animation = fade, 1, 7, default
# animation = workspaces, 1, 6, default
animation=windows,1,8,default,popin 20%
}
misc {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
force_default_wallpaper = 0
focus_on_activate = 1
enable_swallow = 1
swallow_regex = ^(Alacritty|foot|footclient)$
}
dwindle {
# See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
preserve_split = yes # you probably want this
}
master {
new_is_master = false
drop_at_cursor = false
}
gestures {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
workspace_swipe = 1
}

View File

@ -0,0 +1,13 @@
# Prgrams that I run when Hyprland starts.
exec-once = pypr
exec-once = swww init
exec-once = cron -f ~/.config/cron/cron.conf
exec-once = waybar
exec-once = mpd --no-daemon "$HOME"/.config/mpd/mpd.conf
exec-once = pipewire
exec-once = pipewire-pulse
exec-once = wireplumber
exec-once = foot --server
exec-once = swayidle -w timeout 500 'swaylock'
exec-once = xrdb ~/.config/.Xdefaults

View File

@ -0,0 +1,96 @@
# [[ Keybinds ]]
$mainMod = SUPER
# Custom Keybinds.
bind = $mainMod, return, exec, $terminal
bindr= $mainMod, D, exec, $menu
bind = $mainMod, w, exec, chromium
bind = $mainMod, f, exec, hyprctl dispatch togglefloating; pkill -SIGRTMIN+8 waybar # hyprctl dispatch right in your script just so you can exec at the same time
bind = $mainMod SHIFT, f, fullscreen,
bind = SU$PER_SHIFT, l, exec, swaylock
bind = $mainMod, q, killactive,
bind = SUPER_SHIFT, q, exec, sysact
bind = ,Print, exec, grimblast -n copy screen
bind = $mainMod SHIFT, r , exec, screencast
bind = $mainMod SHIFT, s, exec, grimblast -n copy area
bind = ALT,m , exec, pypr menu
bind = $mainMod SHIFT,Print, exec, shareurl.sh
bind = ALT SHIFT, Return , exec, pypr expose
bind = ,XF86PowerOff, exec, doas zzz -z
# [[ KeyChords ]]
bind = $mainMod, SPACE , submap, menusubmap
submap = menusubmap
bind = ,i,exec,foot -e nsxiv ~/pics/classic/art -t -g 1500x700
bind = ,i,submap,reset
bind = ,m,exec,dmenumount
bind = ,m,submap,reset
bind = ,u,exec,dmenuumount
bind = ,u,submap,reset
bind = ,q,exec,sysact
bind = ,q,submap,reset
bind=,escape,submap,reset
submap = reset
# [[ Window management ]]
# Move focus with mainMod + arrow keys
bind = $mainMod, J, layoutmsg,cyclenext
bind = $mainMod, K, layoutmsg,cycleprev
# Swap windows
bind = $mainMod SHIFT, J, swapnext, next
bind = $mainMod SHIFT, K, swapnext, prev
# Resize windows
bind = $mainMod, l, resizeactive, 40 0
bind = $mainMod, h, resizeactive, -40 0
# Switch workspaces with mainMod + [0-9]
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10
# Cycle through ocuped workspaces
bind = ALT, Tab, workspace, m+1
bind = ALT SHIFT, Tab, workspace, m-1
# Move active window to a workspace with mainMod + SHIFT + [0-9]
bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1
bind = $mainMod SHIFT, 2, movetoworkspacesilent, 2
bind = $mainMod SHIFT, 3, movetoworkspacesilent, 3
bind = $mainMod SHIFT, 4, movetoworkspacesilent, 4
bind = $mainMod SHIFT, 5, movetoworkspacesilent, 5
bind = $mainMod SHIFT, 6, movetoworkspacesilent, 6
bind = $mainMod SHIFT, 7, movetoworkspacesilent, 7
bind = $mainMod SHIFT, 8, movetoworkspacesilent, 8
bind = $mainMod SHIFT, 9, movetoworkspacesilent, 9
bind = $mainMod SHIFT, 0, movetoworkspacesilent, 10
# Scroll through existing workspaces with mainMod + scroll
bind = $mainMod, mouse_down, workspace, e+1
bind = $mainMod, mouse_up, workspace, e-1
# Move/resize windows with mainMod + LMB/RMB and dragging
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow
# Audio MPC commands
bind = ,XF86AudioPlay, exec, mpc toggle
bind = ,XF86AudioStop, exec, mpc stop
bind = ,XF86AudioNext, exec, mpc next
bind = ,XF86AudioPrev, exec, mpc prev
binde =, XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.0 @DEFAULT_AUDIO_SINK@ 5%+
binde =, XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-
bindl =, XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle
# Screen Brightness
bind=,XF86MonBrightnessUp,exec,doas brightnessctl set +10%
bind=,XF86MonBrightnessDown,exec,doas brightnessctl set 10%-

View File

@ -0,0 +1,27 @@
# [[ Scratchpads rules ]]
# Keybind
# window rules
bind = $mainMod Shift,Return,exec,pypr toggle term
$dropterm = (term)$
windowrule = float,$dropterm
windowrule = workspace special silent,$dropterm
windowrule = size 75% 60%,$dropterm
bind = ALT,Return,exec,pypr toggle fetch
$fetch = (venom_fetch)$
windowrule = float,$fetch
windowrule = workspace special silent,$fetch
windowrule = size 75% 60%,$fetch
bind = $mainMod,m,exec,pypr toggle music_player
$music_player = (music_player)$
windowrule = float,$music_player
windowrule = workspace special silent,$music_player
windowrule = size 75% 60%,$music_player
bind = $mainMod,e,exec,pypr toggle nnn
$nnn = (nnn)$
windowrule = float,$nnn
windowrule = workspace special silent,$nnn
windowrule = size 75% 60%,$nnn

19
install.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
# Created By: Javier Pacheco - jpacheco@cock.li
# Created On: 03/04/24
# Project: Installer script of my dotfiles.
stow_installed() {
[ -x $(which stow) ]
}
case "$?" in
0) echo "stow is installed"
;;
1) echo "stow is not installed"
;;
*) exit 0
;;
esac