mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-06 01:49:23 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| aa70eab5fb | |||
| e5311ca285 | |||
| d5618c9b5f | |||
| d091f5a88f | |||
| cb9195e3ad | |||
| c91cc387b6 |
@@ -8,6 +8,9 @@ indent_style = space
|
|||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
[*.md]
|
||||||
|
max_line_length = 100
|
||||||
|
|
||||||
[*.php]
|
[*.php]
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|
||||||
|
|||||||
10
.github/README.md
vendored
10
.github/README.md
vendored
@@ -6,10 +6,10 @@ aware of yet. As I find more interesting tools, configs and other stuff,
|
|||||||
this repository will live accordingly.
|
this repository will live accordingly.
|
||||||
|
|
||||||
Please for the love of everything good do not use these 1:1 as your own dotfiles,
|
Please for the love of everything good do not use these 1:1 as your own dotfiles,
|
||||||
fork or download the repo as a zip and go from there with your own configs.
|
fork or download the repository as a zip and go from there with your own configs.
|
||||||
|
|
||||||
It would be nice if you'd add an issue linking to your fork or repo so I can
|
It would be nice if you'd add an issue linking to your fork or repo so I can
|
||||||
see what interesing stuff you've done with it. Sharing is caring.
|
see what interesting stuff you've done with it. Sharing is caring.
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
@@ -28,9 +28,9 @@ see what interesing stuff you've done with it. Sharing is caring.
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Interesting files and locations
|
## Interesting files and locations
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ see what interesing stuff you've done with it. Sharing is caring.
|
|||||||
| `local/` | `.local/` | XDG Base folder: `bin`, `share` and `state` |
|
| `local/` | `.local/` | XDG Base folder: `bin`, `share` and `state` |
|
||||||
| `ssh/` | `.ssh/` | SSH Configurations. |
|
| `ssh/` | `.ssh/` | SSH Configurations. |
|
||||||
|
|
||||||
### dfm - the dotfiles manager
|
### `dfm` - the dotfiles manager
|
||||||
|
|
||||||
[`.local/bin/dfm`][dfm] is a shell script that has some tools that help with dotfiles management.
|
[`.local/bin/dfm`][dfm] is a shell script that has some tools that help with dotfiles management.
|
||||||
|
|
||||||
|
|||||||
@@ -54,8 +54,9 @@ load_antigen()
|
|||||||
antigen bundle colored-man-pages
|
antigen bundle colored-man-pages
|
||||||
antigen bundle zsh-users/zsh-completions
|
antigen bundle zsh-users/zsh-completions
|
||||||
x-have eza && antigen bundle eza
|
x-have eza && antigen bundle eza
|
||||||
|
x-have tms && antigen bundle yuki-ycino/tms
|
||||||
|
|
||||||
# this needs to be the last item
|
# this needs to be the last bundle
|
||||||
antigen bundle zsh-users/zsh-syntax-highlighting
|
antigen bundle zsh-users/zsh-syntax-highlighting
|
||||||
antigen apply
|
antigen apply
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ ansible
|
|||||||
pipenv
|
pipenv
|
||||||
semgrep
|
semgrep
|
||||||
neovim
|
neovim
|
||||||
|
libtmux
|
||||||
|
|||||||
@@ -15,3 +15,6 @@ trim_trailing_whitespace = true
|
|||||||
[*.md]
|
[*.md]
|
||||||
max_line_length = off
|
max_line_length = off
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
|
[*.json]
|
||||||
|
max_line_length = off
|
||||||
|
|||||||
@@ -51,4 +51,21 @@ autocmd('FileType', {
|
|||||||
callback = function(event) vim.bo[event.buf].buflisted = false end,
|
callback = function(event) vim.bo[event.buf].buflisted = false end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- ── wrap and check for spell in text filetypes ──────────────────────
|
||||||
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
|
group = augroup('wrap_spell', { clear = true }),
|
||||||
|
pattern = { 'text', 'plaintex', 'typst', 'gitcommit', 'markdown' },
|
||||||
|
callback = function()
|
||||||
|
vim.opt_local.wrap = true
|
||||||
|
vim.opt_local.spell = true
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- ── Fix conceallevel for json files ─────────────────────────────────
|
||||||
|
vim.api.nvim_create_autocmd({ 'FileType' }, {
|
||||||
|
group = augroup('json_conceal', { clear = true }),
|
||||||
|
pattern = { 'json', 'jsonc', 'json5' },
|
||||||
|
callback = function() vim.opt_local.conceallevel = 0 end,
|
||||||
|
})
|
||||||
|
|
||||||
-- vim: ts=2 sts=2 sw=2 et
|
-- vim: ts=2 sts=2 sw=2 et
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ vim.g.colors_variant_dark = 'tokyonight-storm'
|
|||||||
-- Make sure editorconfig support is enabled
|
-- Make sure editorconfig support is enabled
|
||||||
vim.g.editorconfig = true
|
vim.g.editorconfig = true
|
||||||
|
|
||||||
|
-- Enable the colorcolumn
|
||||||
|
vim.api.nvim_set_option_value('colorcolumn', '+1', { scope = 'global' })
|
||||||
|
|
||||||
-- Enable line numbers and relative line numbers
|
-- Enable line numbers and relative line numbers
|
||||||
vim.opt.number = true
|
vim.opt.number = true
|
||||||
vim.opt.relativenumber = true
|
vim.opt.relativenumber = true
|
||||||
|
|||||||
@@ -1,49 +1,45 @@
|
|||||||
-- ── Formatting ──────────────────────────────────────────────────────
|
-- ── Formatting ──────────────────────────────────────────────────────
|
||||||
-- Lightweight yet powerful formatter plugin for Neovim
|
-- Lightweight yet powerful formatter plugin for Neovim
|
||||||
-- https://github.com/stevearc/conform.nvim
|
-- https://github.com/stevearc/conform.nvim
|
||||||
return {
|
|
||||||
'stevearc/conform.nvim',
|
|
||||||
event = { 'BufWritePre' },
|
|
||||||
cmd = { 'ConformInfo' },
|
|
||||||
config = function()
|
|
||||||
-- Select first conform formatter that is available
|
|
||||||
---@param bufnr integer
|
|
||||||
---@param ... string
|
|
||||||
---@return string
|
|
||||||
local function first(bufnr, ...)
|
|
||||||
local conform = require 'conform'
|
|
||||||
for i = 1, select('#', ...) do
|
|
||||||
local formatter = select(i, ...)
|
|
||||||
if conform.get_formatter_info(formatter, bufnr).available then
|
|
||||||
return formatter
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return select(1, ...)
|
|
||||||
end
|
|
||||||
|
|
||||||
require('conform').setup {
|
return {
|
||||||
|
{
|
||||||
|
'stevearc/conform.nvim',
|
||||||
|
event = { 'BufWritePre' },
|
||||||
|
cmd = { 'ConformInfo' },
|
||||||
|
opts = {
|
||||||
-- Enable or disable logging
|
-- Enable or disable logging
|
||||||
notify_on_error = true,
|
notify_on_error = false,
|
||||||
-- Set the default formatter for all filetypes
|
-- Set the default formatter for all filetypes
|
||||||
default_formatter = 'injected',
|
default_formatter = 'injected',
|
||||||
-- Set the default formatter for all filetypes
|
-- Set the default formatter for all filetypes
|
||||||
default_formatter_opts = {
|
default_formatter_opts = {
|
||||||
lsp_format = 'fallback',
|
lsp_format = 'fallback',
|
||||||
-- Set the default formatter for all filetypes
|
-- Set the default formatter for all filetypes
|
||||||
-- formatter = 'injected',
|
formatter = 'injected',
|
||||||
-- Set the default formatter for all filetypes
|
-- Set the default formatter for all filetypes
|
||||||
-- formatter_opts = {},
|
-- formatter_opts = {},
|
||||||
},
|
},
|
||||||
|
-- The options you set here will be merged with the builtin formatters.
|
||||||
|
-- You can also define any custom formatters here.
|
||||||
|
formatters = {
|
||||||
|
injected = { options = { ignore_errors = true } },
|
||||||
|
-- # Example of using dprint only when a dprint.json file is present
|
||||||
|
-- dprint = {
|
||||||
|
-- condition = function(ctx)
|
||||||
|
-- return vim.fs.find({ "dprint.json" }, { path = ctx.filename, upward = true })[1]
|
||||||
|
-- end,
|
||||||
|
-- },
|
||||||
|
--
|
||||||
|
-- # Example of using shfmt with extra args
|
||||||
|
-- shfmt = {
|
||||||
|
-- prepend_args = { "-i", "2", "-ci" },
|
||||||
|
-- },
|
||||||
|
},
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
markdown = function(bufnr)
|
|
||||||
return { first(bufnr, 'prettierd', 'prettier'), 'injected' }
|
|
||||||
end,
|
|
||||||
javascript = function(bufnr)
|
|
||||||
return { first(bufnr, 'prettier', 'eslint'), 'injected' }
|
|
||||||
end,
|
|
||||||
lua = { 'stylua' },
|
lua = { 'stylua' },
|
||||||
-- Conform will run multiple formatters sequentially
|
-- Conform will run multiple formatters sequentially
|
||||||
-- python = { 'isort', 'black', lsp_format = 'fallback' },
|
go = { 'goimports', 'gofmt' },
|
||||||
-- You can customize some of the format options for the filetype (:help conform.format)
|
-- You can customize some of the format options for the filetype (:help conform.format)
|
||||||
-- rust = { 'rustfmt', lsp_format = 'fallback' },
|
-- rust = { 'rustfmt', lsp_format = 'fallback' },
|
||||||
},
|
},
|
||||||
@@ -59,9 +55,7 @@ return {
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- Disable with a global or buffer-local variable
|
-- Disable with a global or buffer-local variable
|
||||||
if
|
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||||
vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat
|
|
||||||
then
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- Disable autoformat for files in a certain path
|
-- Disable autoformat for files in a certain path
|
||||||
@@ -73,12 +67,20 @@ return {
|
|||||||
|
|
||||||
return { timeout_ms = 500, lsp_format = 'fallback' }
|
return { timeout_ms = 500, lsp_format = 'fallback' }
|
||||||
end,
|
end,
|
||||||
}
|
},
|
||||||
end,
|
init = function()
|
||||||
init = function()
|
-- If you want the formatexpr, here is the place to set it
|
||||||
-- If you want the formatexpr, here is the place to set it
|
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||||
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
end,
|
||||||
end,
|
},
|
||||||
|
-- Automatically install formatters registered with conform.nvim via mason.nvim
|
||||||
|
-- https://github.com/zapling/mason-conform.nvim
|
||||||
|
{
|
||||||
|
'zapling/mason-conform.nvim',
|
||||||
|
depends = {
|
||||||
|
'stevearc/conform.nvim',
|
||||||
|
'williamboman/mason.nvim',
|
||||||
|
},
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ return {
|
|||||||
hide_preview = false,
|
hide_preview = false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- These two configs can also be passed down to the goto-preview definition and implementation calls for one off "peak" functionality.
|
-- These two configs can also be passed down to the goto-preview definition
|
||||||
|
-- and implementation calls for one off "peak" functionality.
|
||||||
focus_on_open = true, -- Focus the floating window when opening it.
|
focus_on_open = true, -- Focus the floating window when opening it.
|
||||||
dismiss_on_move = false, -- Dismiss the floating window when moving the cursor.
|
dismiss_on_move = false, -- Dismiss the floating window when moving the cursor.
|
||||||
force_close = true, -- passed into vim.api.nvim_win_close's second argument. See :h nvim_win_close
|
force_close = true, -- passed into vim.api.nvim_win_close's second argument. See :h nvim_win_close
|
||||||
|
|||||||
@@ -16,6 +16,28 @@ return {
|
|||||||
local builtin = require 'statuscol.builtin'
|
local builtin = require 'statuscol.builtin'
|
||||||
require('statuscol').setup {
|
require('statuscol').setup {
|
||||||
relculright = true,
|
relculright = true,
|
||||||
|
ft_ignore = {
|
||||||
|
'dashboard',
|
||||||
|
'NvimTree',
|
||||||
|
'help',
|
||||||
|
'vim',
|
||||||
|
'alpha',
|
||||||
|
'dashboard',
|
||||||
|
'neo-tree',
|
||||||
|
'Trouble',
|
||||||
|
'lazy',
|
||||||
|
'toggleterm',
|
||||||
|
},
|
||||||
|
bt_ignore = {
|
||||||
|
'help',
|
||||||
|
'vim',
|
||||||
|
'alpha',
|
||||||
|
'dashboard',
|
||||||
|
'neo-tree',
|
||||||
|
'Trouble',
|
||||||
|
'lazy',
|
||||||
|
'toggleterm',
|
||||||
|
},
|
||||||
segments = {
|
segments = {
|
||||||
{
|
{
|
||||||
text = { builtin.foldfunc },
|
text = { builtin.foldfunc },
|
||||||
@@ -41,7 +63,7 @@ return {
|
|||||||
config = function()
|
config = function()
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
capabilities.textDocument.foldingRange = {
|
capabilities.textDocument.foldingRange = {
|
||||||
dynamicRegistration = false,
|
dynamicRegistration = true,
|
||||||
lineFoldingOnly = true,
|
lineFoldingOnly = true,
|
||||||
}
|
}
|
||||||
local language_servers = require('lspconfig').util.available_servers() -- or list servers manually like {'gopls', 'clangd'}
|
local language_servers = require('lspconfig').util.available_servers() -- or list servers manually like {'gopls', 'clangd'}
|
||||||
@@ -84,7 +106,13 @@ return {
|
|||||||
---@param width number The width of the window.
|
---@param width number The width of the window.
|
||||||
---@param truncate function Truncate function
|
---@param truncate function Truncate function
|
||||||
---@return table
|
---@return table
|
||||||
fold_virt_text_handler = function(virtText, lnum, endLnum, width, truncate)
|
fold_virt_text_handler = function(
|
||||||
|
virtText,
|
||||||
|
lnum,
|
||||||
|
endLnum,
|
||||||
|
width,
|
||||||
|
truncate
|
||||||
|
)
|
||||||
local newVirtText = {}
|
local newVirtText = {}
|
||||||
local suffix = (' %d '):format(endLnum - lnum)
|
local suffix = (' %d '):format(endLnum - lnum)
|
||||||
local sufWidth = vim.fn.strdisplaywidth(suffix)
|
local sufWidth = vim.fn.strdisplaywidth(suffix)
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Extensible Neovim Scrollbar
|
-- A neovim plugin that shows colorcolumn dynamically
|
||||||
-- https://github.com/petertriho/nvim-scrollbar
|
-- https://github.com/Bekaboo/deadcolumn.nvim
|
||||||
{ 'petertriho/nvim-scrollbar', opts = {} },
|
{ 'Bekaboo/deadcolumn.nvim' },
|
||||||
|
|
||||||
-- vim dashboard
|
-- vim dashboard
|
||||||
-- https://github.com/nvimdev/dashboard-nvim
|
-- https://github.com/nvimdev/dashboard-nvim
|
||||||
@@ -110,25 +110,64 @@ return {
|
|||||||
{
|
{
|
||||||
'lukas-reineke/indent-blankline.nvim',
|
'lukas-reineke/indent-blankline.nvim',
|
||||||
main = 'ibl',
|
main = 'ibl',
|
||||||
config = function()
|
opts = {
|
||||||
require('ibl').setup {
|
scope = { show_start = false, show_end = false },
|
||||||
indent = {
|
indent = {
|
||||||
char = '│',
|
char = '│',
|
||||||
|
tab_char = '│',
|
||||||
|
},
|
||||||
|
exclude = {
|
||||||
|
filetypes = {
|
||||||
|
'Trouble',
|
||||||
|
'alpha',
|
||||||
|
'dashboard',
|
||||||
|
'help',
|
||||||
|
'lazy',
|
||||||
|
'lazyterm',
|
||||||
|
'mason',
|
||||||
|
'neo-tree',
|
||||||
|
'notify',
|
||||||
|
'terminal',
|
||||||
|
'toggleterm',
|
||||||
|
'trouble',
|
||||||
},
|
},
|
||||||
exclude = {
|
buftypes = { 'dashboard' },
|
||||||
filetypes = { 'terminal', 'dashboard' },
|
},
|
||||||
buftypes = { 'dashboard' },
|
},
|
||||||
},
|
},
|
||||||
}
|
|
||||||
|
-- Display a character as the colorcolumn
|
||||||
|
-- https://github.com/lukas-reineke/virt-column.nvim
|
||||||
|
{ 'lukas-reineke/virt-column.nvim', opts = {} },
|
||||||
|
|
||||||
|
-- icons
|
||||||
|
{
|
||||||
|
'echasnovski/mini.icons',
|
||||||
|
opts = {
|
||||||
|
file = {
|
||||||
|
['.keep'] = { glyph = '', hl = 'MiniIconsGrey' },
|
||||||
|
['devcontainer.json'] = { glyph = '', hl = 'MiniIconsAzure' },
|
||||||
|
},
|
||||||
|
filetype = {
|
||||||
|
dotenv = { glyph = '', hl = 'MiniIconsYellow' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
package.preload['nvim-web-devicons'] = function()
|
||||||
|
require('mini.icons').mock_nvim_web_devicons()
|
||||||
|
return package.loaded['nvim-web-devicons']
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- ui components
|
||||||
|
{ 'MunifTanjim/nui.nvim', lazy = true },
|
||||||
|
|
||||||
-- Git integration for buffers
|
-- Git integration for buffers
|
||||||
-- https://github.com/lewis6991/gitsigns.nvim
|
-- https://github.com/lewis6991/gitsigns.nvim
|
||||||
{
|
{
|
||||||
'lewis6991/gitsigns.nvim',
|
'lewis6991/gitsigns.nvim',
|
||||||
version = false,
|
version = false,
|
||||||
lazy = false,
|
|
||||||
opts = {
|
opts = {
|
||||||
signs = {
|
signs = {
|
||||||
add = { text = '+' },
|
add = { text = '+' },
|
||||||
@@ -174,6 +213,7 @@ return {
|
|||||||
'TmuxNavigateRight',
|
'TmuxNavigateRight',
|
||||||
'TmuxNavigatePrevious',
|
'TmuxNavigatePrevious',
|
||||||
},
|
},
|
||||||
|
opts = {},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Cloak allows you to overlay *'s over defined patterns in defined files.
|
-- Cloak allows you to overlay *'s over defined patterns in defined files.
|
||||||
|
|||||||
@@ -141,8 +141,8 @@ return {
|
|||||||
{
|
{
|
||||||
'<leader>cf',
|
'<leader>cf',
|
||||||
'<cmd>lua require("conform").format({ async = true, lsp_fallback = true })<cr>',
|
'<cmd>lua require("conform").format({ async = true, lsp_fallback = true })<cr>',
|
||||||
mode = { 'n', 'v' },
|
mode = {},
|
||||||
desc = 'Format buffer',
|
desc = 'Format buffer with Conform',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'<leader>ci',
|
'<leader>ci',
|
||||||
@@ -509,7 +509,7 @@ return {
|
|||||||
},
|
},
|
||||||
|
|
||||||
-- ── Old habits ──────────────────────────────────────────────────────
|
-- ── Old habits ──────────────────────────────────────────────────────
|
||||||
{ '<C-s>', '<cmd>w<CR>', desc = 'Save file' },
|
{ '<C-s>', '<cmd>w!<CR>', desc = 'Save file' },
|
||||||
|
|
||||||
-- ── Text manipulation in visual mode ────────────────────────────────
|
-- ── Text manipulation in visual mode ────────────────────────────────
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user