Compare commits
1 commit
main
...
legacy-for
| Author | SHA1 | Date | |
|---|---|---|---|
| 12297f538e |
19 changed files with 88 additions and 186 deletions
|
|
@ -1,14 +0,0 @@
|
||||||
-- example of a project specific nvim configuration file using :exrc and conform
|
|
||||||
|
|
||||||
local conform = require 'conform';
|
|
||||||
|
|
||||||
conform.setup {
|
|
||||||
formatters_by_ft = {
|
|
||||||
python = { 'isort', 'black' },
|
|
||||||
javascript = { 'prettier', },
|
|
||||||
},
|
|
||||||
|
|
||||||
format_on_save = {
|
|
||||||
lsp_format = 'never',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
-- example of a project specific nvim configuration file using :exrc and lsp formatting
|
|
||||||
|
|
||||||
local format_clients = {
|
|
||||||
'ruff',
|
|
||||||
'lua_ls',
|
|
||||||
'bashls',
|
|
||||||
'jsonls',
|
|
||||||
'ts_ls',
|
|
||||||
'ansiblels',
|
|
||||||
'yamlls',
|
|
||||||
'cssls',
|
|
||||||
'html',
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
|
||||||
group = vim.api.nvim_create_augroup('lsp', { clear = true }),
|
|
||||||
callback = function(args)
|
|
||||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
|
||||||
|
|
||||||
if client:supports_method('textDocument/formatting')
|
|
||||||
and vim.tbl_contains(format_clients, client.name) then
|
|
||||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
|
||||||
buffer = args.buf,
|
|
||||||
callback = function()
|
|
||||||
vim.lsp.buf.format {
|
|
||||||
async = false,
|
|
||||||
id = args.data.client_id
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end
|
|
||||||
})
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
session_name=${PWD##*/}
|
session_name=${PWD##*/}
|
||||||
project_directory="$HOME/development/$session_name"
|
project_directory="$HOME/development/$session_name"
|
||||||
|
enable_formatting="false"
|
||||||
|
|
||||||
tmux has-session -t $session_name
|
tmux has-session -t $session_name
|
||||||
|
|
||||||
|
|
@ -10,7 +11,8 @@ then
|
||||||
tmux new-session \
|
tmux new-session \
|
||||||
-c $project_directory \
|
-c $project_directory \
|
||||||
-ds $session_name \
|
-ds $session_name \
|
||||||
-e "project_dir=$project_directory"
|
-e "project_dir=$project_directory" \
|
||||||
|
-e "enable_formatting=$enable_formatting"
|
||||||
|
|
||||||
# FIRST WINDOW
|
# FIRST WINDOW
|
||||||
tmux send-keys -t $session_name:0 'source ./env/bin/activate' C-m
|
tmux send-keys -t $session_name:0 'source ./env/bin/activate' C-m
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ neovim_plugins:
|
||||||
name: 'cmp-nvim-lua'
|
name: 'cmp-nvim-lua'
|
||||||
- url: 'https://github.com/nvim-treesitter/nvim-treesitter'
|
- url: 'https://github.com/nvim-treesitter/nvim-treesitter'
|
||||||
name: 'nvim-treesitter'
|
name: 'nvim-treesitter'
|
||||||
version: master # main seems broken?
|
|
||||||
- url: 'https://github.com/nvim-lua/plenary.nvim'
|
- url: 'https://github.com/nvim-lua/plenary.nvim'
|
||||||
name: 'plenary.nvim'
|
name: 'plenary.nvim'
|
||||||
- url: 'https://github.com/nvim-telescope/telescope-fzf-native.nvim'
|
- url: 'https://github.com/nvim-telescope/telescope-fzf-native.nvim'
|
||||||
|
|
@ -43,8 +42,5 @@ neovim_plugins:
|
||||||
- url: 'https://github.com/projekt0n/github-nvim-theme.git'
|
- url: 'https://github.com/projekt0n/github-nvim-theme.git'
|
||||||
name: 'github-colors'
|
name: 'github-colors'
|
||||||
version: 'v1.1.2'
|
version: 'v1.1.2'
|
||||||
- url: 'https://github.com/stevearc/conform.nvim.git'
|
|
||||||
name: 'conform.nvim'
|
|
||||||
version: 'v9.0.0'
|
|
||||||
|
|
||||||
language_servers: []
|
language_servers: []
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,4 @@ packages:
|
||||||
- slirp4netns
|
- slirp4netns
|
||||||
- tree-sitter
|
- tree-sitter
|
||||||
- ripgrep
|
- ripgrep
|
||||||
- fd
|
|
||||||
- uv
|
- uv
|
||||||
- fakeroot
|
|
||||||
- debugedit
|
|
||||||
- which
|
|
||||||
- gcc
|
|
||||||
- make
|
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
# TODO: add lua language server, see https://github.com/LuaLS/lua-language-server?
|
# TODO: add lua language server, see https://github.com/LuaLS/lua-language-server?
|
||||||
language_servers:
|
language_servers:
|
||||||
- package: "@ansible/ansible-language-server"
|
- package: '@ansible/ansible-language-server'
|
||||||
server_name: "ansiblels"
|
server_name: 'ansiblels'
|
||||||
auto_setup: true
|
auto_setup: true
|
||||||
|
|
||||||
- package: yaml-language-server
|
- package: yaml-language-server
|
||||||
server_name: "yamlls"
|
server_name: 'yamlls'
|
||||||
auto_setup: false
|
auto_setup: false
|
||||||
|
|
||||||
- package: bash-language-server
|
- package: bash-language-server
|
||||||
server_name: "bashls"
|
server_name: 'bashls'
|
||||||
auto_setup: true
|
auto_setup: true
|
||||||
|
|
||||||
neovim:
|
neovim:
|
||||||
version: "v0.11.4"
|
version: 'v0.10.4'
|
||||||
install_path: "/opt/nvim"
|
install_path: '/opt/nvim'
|
||||||
download_checksum: sha256:a74740047e73b2b380d63a474282814063d10650cd6cc95efa16d1713c7e616c
|
download_checksum: sha256:95aaa8e89473f5421114f2787c13ae0ec6e11ebbd1a13a1bd6fcf63420f8073f
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,6 @@ personal:
|
||||||
desktop: &desktop
|
desktop: &desktop
|
||||||
ansible_connection: local
|
ansible_connection: local
|
||||||
ansible_become_method: community.general.run0
|
ansible_become_method: community.general.run0
|
||||||
htpc: &htpc
|
|
||||||
ansible_connection: local
|
|
||||||
ansible_become_method: community.general.run0
|
|
||||||
fudiggity: &fudiggity
|
fudiggity: &fudiggity
|
||||||
ansible_connection: local
|
ansible_connection: local
|
||||||
|
|
||||||
|
|
@ -23,5 +20,3 @@ arch:
|
||||||
<<: *xps
|
<<: *xps
|
||||||
desktop:
|
desktop:
|
||||||
<<: *desktop
|
<<: *desktop
|
||||||
htpc:
|
|
||||||
<<: *htpc
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
- name: Development provisioning
|
- name: Development provisioning
|
||||||
hosts:
|
hosts:
|
||||||
- personal
|
- xps
|
||||||
- arch
|
- desktop
|
||||||
- debian
|
- fudiggity
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
- name: Verifying that a limit is set
|
- name: Verifying that a limit is set
|
||||||
ansible.builtin.fail:
|
ansible.builtin.fail:
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
- src: git+https://forgejo.fudiggity.nl/sonny/common-ansible.git
|
- src: git+https://git.fudiggity.nl/ansible/common.git
|
||||||
name: common
|
name: common
|
||||||
version: master
|
version: master
|
||||||
scm: git
|
scm: git
|
||||||
|
|
|
||||||
|
|
@ -38,15 +38,9 @@
|
||||||
- src: '{{ ansible_env.HOME }}/dotfiles/.profile'
|
- src: '{{ ansible_env.HOME }}/dotfiles/.profile'
|
||||||
dest: '{{ ansible_env.HOME }}/.profile'
|
dest: '{{ ansible_env.HOME }}/.profile'
|
||||||
|
|
||||||
- src: '{{ ansible_env.HOME }}/dotfiles/tmux/tmux.conf'
|
- src: '{{ ansible_env.HOME }}/dotfiles/.tmux.conf'
|
||||||
dest: '{{ xdg_config_dir }}/tmux/tmux.conf'
|
dest: '{{ xdg_config_dir }}/tmux/tmux.conf'
|
||||||
|
|
||||||
- src: '{{ ansible_env.HOME }}/dotfiles/tmux/light.conf'
|
|
||||||
dest: '{{ xdg_config_dir }}/tmux/light.conf'
|
|
||||||
|
|
||||||
- src: '{{ ansible_env.HOME }}/dotfiles/tmux/dark.conf'
|
|
||||||
dest: '{{ xdg_config_dir }}/tmux/dark.conf'
|
|
||||||
|
|
||||||
- src: '{{ ansible_env.HOME }}/dotfiles/.gitignore'
|
- src: '{{ ansible_env.HOME }}/dotfiles/.gitignore'
|
||||||
dest: '{{ xdg_config_dir }}/git/ignore'
|
dest: '{{ xdg_config_dir }}/git/ignore'
|
||||||
|
|
||||||
|
|
@ -55,15 +49,3 @@
|
||||||
src: 'templates/gitconfig.j2'
|
src: 'templates/gitconfig.j2'
|
||||||
dest: '{{ xdg_config_dir }}/git/config'
|
dest: '{{ xdg_config_dir }}/git/config'
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: Create script directory
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: '{{ ansible_env.HOME }}/.local/bin'
|
|
||||||
state: directory
|
|
||||||
mode: '0755'
|
|
||||||
|
|
||||||
- name: Copy tmux toggle script
|
|
||||||
ansible.builtin.template:
|
|
||||||
src: 'templates/tmux-toggle.j2'
|
|
||||||
dest: '{{ ansible_env.HOME }}/.local/bin/tmux-toggle.sh'
|
|
||||||
mode: '0755'
|
|
||||||
|
|
|
||||||
|
|
@ -121,5 +121,5 @@
|
||||||
- src: 'templates/nvim/lua/filetype.lua.j2'
|
- src: 'templates/nvim/lua/filetype.lua.j2'
|
||||||
dest: '{{ xdg_config_dir }}/nvim/lua/_filetype.lua'
|
dest: '{{ xdg_config_dir }}/nvim/lua/_filetype.lua'
|
||||||
|
|
||||||
- src: 'templates/nvim/lua/diagnostic.lua.j2'
|
- src: 'templates/nvim/lua/formatting.lua.j2'
|
||||||
dest: '{{ xdg_config_dir }}/nvim/lua/diagnostic.lua'
|
dest: '{{ xdg_config_dir }}/nvim/lua/formatting.lua'
|
||||||
|
|
|
||||||
|
|
@ -11,4 +11,4 @@ require('indent-blankline')
|
||||||
require('_nvim-tree')
|
require('_nvim-tree')
|
||||||
require('lua-line')
|
require('lua-line')
|
||||||
require('_source-link')
|
require('_source-link')
|
||||||
require('diagnostic')
|
require('formatting')
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ local background_callback = function()
|
||||||
if vim.o.background == 'dark' then
|
if vim.o.background == 'dark' then
|
||||||
vim.cmd('colorscheme github_dark_dimmed')
|
vim.cmd('colorscheme github_dark_dimmed')
|
||||||
else
|
else
|
||||||
vim.cmd('colorscheme github_light_tritanopia')
|
vim.cmd('colorscheme github_light')
|
||||||
end
|
end
|
||||||
|
|
||||||
-- force a full redraw:
|
-- force a full redraw:
|
||||||
|
|
@ -29,7 +29,7 @@ Use the `Introspect` option to inspect available options:
|
||||||
|
|
||||||
dbus-send \
|
dbus-send \
|
||||||
--session \
|
--session \
|
||||||
--print-reply \
|
--print-reply ]
|
||||||
--reply-timeout=2000 \
|
--reply-timeout=2000 \
|
||||||
--type=method_call \
|
--type=method_call \
|
||||||
--dest=org.freedesktop.portal.Desktop \
|
--dest=org.freedesktop.portal.Desktop \
|
||||||
|
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
-- {{ ansible_managed }}
|
|
||||||
|
|
||||||
vim.diagnostic.config {
|
|
||||||
float = {
|
|
||||||
suffix = function(diagnostic)
|
|
||||||
return (' %s | [%s]'):format(diagnostic.code, diagnostic.source)
|
|
||||||
end
|
|
||||||
},
|
|
||||||
|
|
||||||
virtual_text = { current_line = true }
|
|
||||||
}
|
|
||||||
39
templates/nvim/lua/formatting.lua.j2
Normal file
39
templates/nvim/lua/formatting.lua.j2
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
-- {{ ansible_managed }}
|
||||||
|
|
||||||
|
local enable_formatting = vim.env.enable_formatting == 'true';
|
||||||
|
local legacy_formatting = nil;
|
||||||
|
|
||||||
|
-- TODO: move to utils file
|
||||||
|
-- TODO: add efm-languageserver to lsp.lua
|
||||||
|
if vim.env.VIRTUAL_ENV ~= nil and enable_formatting == true then
|
||||||
|
local formatters = vim.fs.find(
|
||||||
|
{ 'isort', 'black' },
|
||||||
|
{ limit = 1, type = 'file', path = vim.fs.joinpath(vim.env.VIRTUAL_ENV, 'bin') }
|
||||||
|
)
|
||||||
|
|
||||||
|
legacy_formatting = #formatters > 0;
|
||||||
|
end
|
||||||
|
|
||||||
|
if (enable_formatting) then
|
||||||
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
|
group = vim.api.nvim_create_augroup('lsp', { clear = true }),
|
||||||
|
callback = function(args)
|
||||||
|
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||||
|
|
||||||
|
if client.server_capabilities.documentFormattingProvider then
|
||||||
|
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||||
|
buffer = args.buf,
|
||||||
|
callback = function()
|
||||||
|
vim.lsp.buf.format {
|
||||||
|
async = false,
|
||||||
|
id = args.data.client_id,
|
||||||
|
filter = function(format_client)
|
||||||
|
return format_client.name ~= 'ruff' or not legacy_formatting
|
||||||
|
end
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
@ -7,29 +7,29 @@ local on_attach = function(client, bufnr)
|
||||||
|
|
||||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
|
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
|
||||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
|
||||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
|
|
||||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
|
||||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
|
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
|
||||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
||||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
|
|
||||||
vim.keymap.set('n', '<space>la', vim.lsp.buf.code_action, opts)
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
|
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
|
||||||
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
||||||
vim.keymap.set('n', '<space>wl', function()
|
vim.keymap.set('n', '<space>wl', function()
|
||||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
end, opts)
|
end, opts)
|
||||||
|
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
|
||||||
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
|
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
|
||||||
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
|
||||||
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
|
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
|
||||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
||||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
||||||
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
||||||
|
vim.keymap.set('n', '<space>la', vim.lsp.buf.code_action, opts)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--enable some language servers with the additional completion capabilities
|
--enable some language servers with the additional completion capabilities
|
||||||
--offered by nvim-cmp
|
--offered by nvim-cmp
|
||||||
local auto_setup_servers = {
|
local servers = {
|
||||||
{% for item in language_servers %}
|
{% for item in language_servers %}
|
||||||
{% if item.auto_setup and not loop.last %}
|
{% if item.auto_setup and not loop.last %}
|
||||||
'{{ item.server_name }}',
|
'{{ item.server_name }}',
|
||||||
|
|
@ -43,8 +43,10 @@ local auto_setup_servers = {
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||||
|
|
||||||
for _, lsp in ipairs(auto_setup_servers) do
|
local nvim_lsp = require('lspconfig')
|
||||||
vim.lsp.config[lsp] = {
|
|
||||||
|
for _, lsp in ipairs(servers) do
|
||||||
|
nvim_lsp[lsp].setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
}
|
||||||
|
|
@ -58,49 +60,42 @@ local python_root_dir = function(fname)
|
||||||
util.path.dirname(fname)
|
util.path.dirname(fname)
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.lsp.config['ruff'] = {
|
nvim_lsp.ruff.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
root_dir = python_root_dir
|
root_dir = python_root_dir
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
vim.lsp.config['pyright'] = {
|
nvim_lsp.pyright.setup {
|
||||||
settings = {
|
settings = {
|
||||||
pyright = {
|
pyright = {
|
||||||
-- Using Ruff's import organizer
|
-- Using Ruff's import organizer
|
||||||
disableOrganizeImports = true,
|
disableOrganizeImports = true,
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
local snippet_capabilities = vim.deepcopy(capabilities);
|
local snippet_capabilities = vim.deepcopy(capabilities);
|
||||||
snippet_capabilities.textDocument.completion.completionItem.snippetSupport = true
|
snippet_capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
|
|
||||||
vim.lsp.config['html'] = {
|
nvim_lsp.html.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = snippet_capabilities,
|
capabilities = snippet_capabilities,
|
||||||
filetypes = { 'html', 'htmldjango' },
|
filetypes = { 'html', 'htmldjango' },
|
||||||
settings = {
|
|
||||||
html = {
|
|
||||||
format = {
|
|
||||||
templating = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.lsp.config['cssls'] = {
|
nvim_lsp.cssls.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = snippet_capabilities,
|
capabilities = snippet_capabilities,
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.lsp.config['jsonls'] = {
|
nvim_lsp.jsonls.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = snippet_capabilities,
|
capabilities = snippet_capabilities,
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.lsp.config['lua_ls'] = {
|
nvim_lsp.lua_ls.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = snippet_capabilities,
|
capabilities = snippet_capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
|
|
@ -113,24 +108,12 @@ vim.lsp.config['lua_ls'] = {
|
||||||
}
|
}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
vim.lsp.config['yamlls'] = {
|
nvim_lsp.yamlls.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
filetypes = { 'yaml', 'yaml.ansible', 'yaml.docker-compose', 'yaml.gitlab' }
|
filetypes = { 'yaml', 'yaml.ansible', 'yaml.docker-compose', 'yaml.gitlab' }
|
||||||
}
|
}
|
||||||
|
|
||||||
local servers = {
|
|
||||||
{% for item in language_servers %}
|
|
||||||
{% if not loop.last %}
|
|
||||||
'{{ item.server_name }}',
|
|
||||||
{% else %}
|
|
||||||
'{{ item.server_name }}'
|
|
||||||
{% endif %}
|
|
||||||
{% endfor %}
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.lsp.enable { unpack(servers) }
|
|
||||||
|
|
||||||
local cmp = require('cmp')
|
local cmp = require('cmp')
|
||||||
local luasnip = require('luasnip')
|
local luasnip = require('luasnip')
|
||||||
|
|
||||||
|
|
@ -196,3 +179,11 @@ cmp.setup {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vim.diagnostic.config {
|
||||||
|
float = {
|
||||||
|
suffix = function(diagnostic)
|
||||||
|
return (' %s | [%s]'):format(diagnostic.code, diagnostic.source)
|
||||||
|
end
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,12 +55,5 @@ vim.o.termguicolors = true
|
||||||
vim.g.loaded_netrw = 1
|
vim.g.loaded_netrw = 1
|
||||||
vim.g.loaded_netrwPlugin = 1
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
-- load project specific configuration files
|
|
||||||
vim.o.exrc = true
|
|
||||||
vim.o.secure = true
|
|
||||||
|
|
||||||
-- disable mouse options
|
|
||||||
vim.opt.mouse = ''
|
|
||||||
|
|
||||||
-- python interpreter
|
-- python interpreter
|
||||||
vim.g.python3_host_prog = '/usr/bin/python3'
|
vim.g.python3_host_prog = '/usr/bin/python3'
|
||||||
|
|
|
||||||
|
|
@ -5,33 +5,20 @@ local builtin = require('telescope.builtin')
|
||||||
|
|
||||||
local opts = { noremap = true, silent = true }
|
local opts = { noremap = true, silent = true }
|
||||||
|
|
||||||
local find_files_unignored = function()
|
|
||||||
builtin.find_files { hidden = true, no_ignore = true }
|
|
||||||
end
|
|
||||||
|
|
||||||
local live_grep_unignored = function()
|
|
||||||
builtin.live_grep { additional_args = { '--unrestricted', '--unrestricted' } }
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.keymap.set('n', 'ff', builtin.find_files, opts)
|
vim.keymap.set('n', 'ff', builtin.find_files, opts)
|
||||||
vim.keymap.set('n', 'fF', find_files_unignored, opts)
|
|
||||||
vim.keymap.set('n', 'fg', builtin.live_grep, opts)
|
vim.keymap.set('n', 'fg', builtin.live_grep, opts)
|
||||||
vim.keymap.set('n', 'fG', live_grep_unignored, opts)
|
vim.keymap.set('n', 'fb', builtin.buffers, opts)
|
||||||
vim.keymap.set('n', 'fb', builtin.current_buffer_fuzzy_find, opts)
|
|
||||||
vim.keymap.set('n', 'fB', builtin.buffers, opts)
|
|
||||||
vim.keymap.set('n', 'fh', builtin.help_tags, opts)
|
vim.keymap.set('n', 'fh', builtin.help_tags, opts)
|
||||||
vim.keymap.set('n', 'fj', builtin.jumplist, opts)
|
vim.keymap.set('n', 'fj', builtin.jumplist, opts)
|
||||||
vim.keymap.set('n', 'fl', builtin.loclist, opts)
|
vim.keymap.set('n', 'fl', builtin.loclist, opts)
|
||||||
vim.keymap.set('n', 'fq', builtin.quickfix, opts)
|
vim.keymap.set('n', 'fq', builtin.quickfix, opts)
|
||||||
vim.keymap.set('n', 'fm', builtin.marks, opts)
|
vim.keymap.set('n', 'fm', builtin.marks, opts)
|
||||||
vim.keymap.set('n', 'ft', builtin.treesitter, opts)
|
|
||||||
|
|
||||||
telescope.setup({
|
telescope.setup({
|
||||||
defaults = {
|
defaults = {
|
||||||
layout_strategy = 'vertical',
|
layout_strategy = 'vertical',
|
||||||
layout_config = {
|
layout_config = {
|
||||||
prompt_position = 'bottom',
|
vertical = { width = 0.5, height = 0.7 }
|
||||||
vertical = { width = 0.8, height = 0.9 }
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
#!/usr/bin/env sh
|
|
||||||
#
|
|
||||||
# {{ ansible_managed }}
|
|
||||||
#
|
|
||||||
# Toggle the current window (all panes) between light and dark themes.
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
current_window_style=$(tmux show -Av window-style)
|
|
||||||
|
|
||||||
case $current_window_style in
|
|
||||||
'fg=#000000,bg=#eff0f1')
|
|
||||||
tmux source-file ~/.config/tmux/dark.conf
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
# Change back to the default window style.
|
|
||||||
tmux source-file ~/.config/tmux/light.conf
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue