Skip to content

Commit 71ff9ec

Browse files
committed
Merge branch 'main' of github.com:aalbaali/workstation_setup
2 parents 8b09f41 + f6ca72d commit 71ff9ec

4 files changed

Lines changed: 51 additions & 30 deletions

File tree

ansible/tasks/setup_nvim.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@
2424
remote_src: true
2525
creates: "/opt/nvim-linux64-{{ nvim_version }}"
2626

27-
- name: Move from temp to opt
28-
ansible.builtin.command: mv /tmp/nvim-linux64 "/opt/nvim-linux64-{{ nvim_version }}"
29-
args:
30-
creates: "/opt/nvim-linux64-{{ nvim_version }}"
27+
- name: Copy from temp to opt
28+
ansible.builtin.copy:
29+
src: /tmp/nvim-linux64/
30+
dest: "/opt/nvim-linux64-{{ nvim_version }}"
31+
remote_src: true
3132

3233
- name: Symlink nvim
3334
ansible.builtin.file:

stow/nvim/.config/nvim/lua/user/lsp/mason.lua

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,49 @@ local servers = {
44
"cmake",
55
"rust_analyzer",
66
"lua_ls",
7-
"jsonls",
7+
"jsonls",
88
"pyright",
9+
"ruff",
910
}
1011

1112
local settings = {
12-
ui = {
13-
border = "none",
14-
-- icons = {
15-
-- package_installed = "◍",
16-
-- package_pending = "◍",
17-
-- package_uninstalled = "◍",
18-
-- },
19-
},
20-
log_level = vim.log.levels.INFO,
21-
max_concurrent_installers = 4,
13+
ui = {
14+
border = "none",
15+
-- icons = {
16+
-- package_installed = "◍",
17+
-- package_pending = "◍",
18+
-- package_uninstalled = "◍",
19+
-- },
20+
},
21+
log_level = vim.log.levels.INFO,
22+
max_concurrent_installers = 4,
2223
}
2324

2425
require("mason").setup(settings)
2526
require("mason-lspconfig").setup({
26-
ensure_installed = servers,
27-
automatic_installation = true,
27+
ensure_installed = servers,
28+
automatic_installation = true,
2829
})
2930

3031
local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig")
31-
if not lspconfig_status_ok then
32-
return
33-
end
32+
if not lspconfig_status_ok then
33+
return
34+
end
3435

3536
local opts = {}
3637

3738
for _, server in pairs(servers) do
38-
opts = {
39-
on_attach = require("user.lsp.handlers").on_attach,
40-
capabilities = require("user.lsp.handlers").capabilities,
41-
}
39+
opts = {
40+
on_attach = require("user.lsp.handlers").on_attach,
41+
capabilities = require("user.lsp.handlers").capabilities,
42+
}
4243

43-
server = vim.split(server, "@")[1]
44+
server = vim.split(server, "@")[1]
4445

45-
local require_ok, conf_opts = pcall(require, "user.lsp.settings." .. server)
46-
if require_ok then
47-
opts = vim.tbl_deep_extend("force", conf_opts, opts)
48-
end
46+
local require_ok, conf_opts = pcall(require, "user.lsp.settings." .. server)
47+
if require_ok then
48+
opts = vim.tbl_deep_extend("force", conf_opts, opts)
49+
end
4950

5051
lspconfig[server].setup(opts)
5152
end
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
return {
2+
settings = {
3+
pyright = {
4+
-- Using Ruff's import organizer
5+
disableOrganizeImports = false,
6+
},
7+
python = {
8+
analysis = {
9+
-- Ignore all files for analysis to exclusively use Ruff for linting
10+
ignore = { '*' },
11+
},
12+
},
13+
},
14+
init_options = {
15+
settings = {
16+
logLevel = 'info', -- Defaults to 'info'
17+
}
18+
}
19+
}

stow/nvim/.config/nvim/lua/user/whichkey.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ local mappings = {
201201
"Workspace Diagnostics",
202202
},
203203
f = { "<cmd>lua vim.lsp.buf.format{async=true}<cr>", "Format" },
204-
F = { "<cmd>!python -m ruff check % --fix --select F841 --fixable F841 --select F401 --fixable F401 && python -m ruff format %<cr>", "Format" },
204+
F = { "<cmd>!python -m ruff check % --fix && python -m ruff format %<cr>", "Format" },
205205
J = { "<cmd>!prettier --write % --log-level warn<cr>", "Format" },
206206
i = { "<cmd>LspInfo<cr>", "Info" },
207207
I = { "<cmd>Mason<cr>", "Installer Info" },

0 commit comments

Comments
 (0)