Skip to content
Closed

Pull #1574

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ vim.g.mapleader = ' '
vim.g.maplocalleader = ' '

-- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = false
vim.g.have_nerd_font = true

-- [[ Setting options ]]
-- See `:help vim.o`
Expand All @@ -102,8 +102,7 @@ vim.g.have_nerd_font = false
vim.o.number = true
-- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it!
-- vim.o.relativenumber = true

vim.opt.relativenumber = true
-- Enable mouse mode, can be useful for resizing splits for example!
vim.o.mouse = 'a'

Expand Down
38 changes: 38 additions & 0 deletions lua/custom/plugins/formatting.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
return {
'stevearc/conform.nvim',
event = { 'BufReadPre', 'BufNewFile' },
config = function()
local conform = require 'conform'

conform.setup {
formatters_by_ft = {
javascript = { 'prettier' },
typescript = { 'prettier' },
javascriptreact = { 'prettier' },
typescriptreact = { 'prettier' },
svelte = { 'prettier' },
css = { 'prettier' },
html = { 'prettier' },
json = { 'prettier' },
yaml = { 'prettier' },
markdown = { 'prettier' },
graphql = { 'prettier' },
lua = { 'stylua' },
python = { 'isort', 'black', 'ruff' },
},
format_on_save = {
lsp_fallback = true,
async = false,
timeout_ms = 500,
},
}

vim.keymap.set({ 'n', 'v' }, '<leader>mp', function()
conform.format {
lsp_fallback = true,
async = false,
timeout_ms = 1000,
}
end, { desc = 'Format file or range (in visual mode)' })
end,
}
18 changes: 18 additions & 0 deletions lua/custom/plugins/vimconfig.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- disable netrw
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1

-- Disable line wrap
vim.opt.wrap = false

-- No swap file
vim.opt.swapfile = false

-- Set shiftwidth and tabstop
vim.opt.shiftwidth = 4
vim.opt.tabstop = 4
vim.opt.softtabstop = 4

vim.opt.termguicolors = true

return {}