From ad41074de56bb3a8dc9063432bc4a1245a4c2280 Mon Sep 17 00:00:00 2001 From: ignuki Date: Thu, 13 Feb 2025 21:24:39 +0100 Subject: [PATCH] enhancements --- .editorconfig | 6 +++++ nvim/.config/nvim/lua/plugins/formatting.lua | 23 ++++++++++++++++++++ nvim/.config/nvim/lua/plugins/linting.lua | 3 +++ zsh/.zshrc | 3 +++ 4 files changed, 35 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..2f694d4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,6 @@ +root = true + +[*.md] +indent_style = space +indent_size = 4 +max_line_length = 80 diff --git a/nvim/.config/nvim/lua/plugins/formatting.lua b/nvim/.config/nvim/lua/plugins/formatting.lua index 60196ea..be8c63e 100644 --- a/nvim/.config/nvim/lua/plugins/formatting.lua +++ b/nvim/.config/nvim/lua/plugins/formatting.lua @@ -84,7 +84,29 @@ return { formatters_by_ft = { -- brew install stylua lua = { "stylua" }, + -- install rust rust = { "rustfmt" }, + -- brew install prettier + markdown = { "prettierd", "prettier" }, + json = { "prettierd", "prettier" }, + yaml = { "prettierd", "prettier" }, + -- install terraform + terraform = { "terraform_fmt" }, + -- brew install shfmt + bash = { "shfmt" }, + -- brew install ruff + python = { "ruff" }, + }, + formatters = { + prettier = { + prepend_args = { "--prose-wrap", "always" }, + }, + shfmt = { + prepend_args = { "-i", "4" }, + }, + ruff = { + prepend_args = { "--extend-select", "I" }, + }, }, format_on_save = { lsp_fallback = true, @@ -92,6 +114,7 @@ return { timeout_ms = 500, }, }) + vim.keymap.set({ "n", "v" }, "mp", function() conform.format({ lsp_fallback = true, diff --git a/nvim/.config/nvim/lua/plugins/linting.lua b/nvim/.config/nvim/lua/plugins/linting.lua index 80e3f15..ede4976 100644 --- a/nvim/.config/nvim/lua/plugins/linting.lua +++ b/nvim/.config/nvim/lua/plugins/linting.lua @@ -5,8 +5,11 @@ return { config = function() local lint = require("lint") lint.linters_by_ft = { + -- brew install luacheck lua = { "luacheck" }, bash = { "bash" }, + -- brew install tflint + terraform = { "tflint" }, } local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) diff --git a/zsh/.zshrc b/zsh/.zshrc index 6ed44d6..56ecb1d 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -12,6 +12,9 @@ setopt HIST_IGNORE_SPACE # Do not record an event starting with a space. setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file. setopt SHARE_HISTORY # Share history between all sessions. +bindkey "^[[1;5C" forward-word +bindkey "^[[1;5D" backward-word + # make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"