Compare commits

..

17 Commits

Author SHA1 Message Date
Tobias
939e3057a8 Making a few updates 2025-11-19 18:24:34 +01:00
w34164
72cfef9698 removing unused config 2025-07-17 14:15:48 +02:00
w34164
93f5c4eeee Updating ansiblels config 2025-07-17 12:22:19 +02:00
w34164
1b710da032 Adding file detection that works with ansible files 2025-07-17 11:54:28 +02:00
5a603aaac0 Adding dockerfile
Adding dockerfile for work with podman
2025-07-10 10:31:54 +02:00
40ddc8351a Adding dockerfile and docker compose
Adding docker file and compose LSP's for work with those filetypes with podman
2025-07-10 10:29:33 +02:00
Tobias
14185f2a77 Updating comments 2025-05-16 20:42:25 +02:00
Tobias
2ed6432443 Updating comments 2025-05-16 20:41:31 +02:00
Tobias
f3a4e44c19 Updating README 2025-05-15 18:16:36 +02:00
Tobias
b8850e216b Adding more in the README for MacOS and opting out of swapfiles 2025-05-15 18:12:49 +02:00
Tobias
3b9053ccb8 Same as last commit and push 2025-05-11 23:13:24 +02:00
Tobias
8d6b770879 Updating README file 2025-05-11 23:11:51 +02:00
Tobias
59f0fa31a6 Editing README 2025-05-11 23:05:56 +02:00
Tobias
dfa38d3453 Removing redundent keymap 2025-05-11 22:36:36 +02:00
Tobias
739b0ad24d Adding .gitignore and updating readme file 2025-05-11 22:12:11 +02:00
Tobias
f763f914c7 Creating keybinds for using tabs when needed 2025-05-11 21:59:43 +02:00
260f35039d outcommenting terraform ls since it works better this way for some reason. I will need to look into 2025-05-02 14:29:49 +02:00
9 changed files with 61 additions and 16 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
lazy-lock.json

View File

@@ -16,6 +16,16 @@ If you are using Ubuntu it can be done like this
sudo apt install neovim npm ansible ansible-lint ripgrep shellcheck
```
If you are using MacOS it can be done like this (Yes ansible is not in there yet, still working on that)
```
brew install neovim npm python@3.12 shellcheck ansible ansible-lint
```
Remember that you need to have the homeberw path exported
```
export PATH=$PATH:/opt/homebrew/bin
```
How to use the plugins and configuration
```
git clone https://git.nopants.dk/shell/neovim_config.git ~/.config/nvim
@@ -26,3 +36,12 @@ This is a simple starter config for neovim, there is a few plugins for changing
### Note:
To use the ansiblels LSP, you need either vs code installed or npm installed. May well be that vs code installs and uses npm to install the ansiblels LSP
There is also some remaps that I could not image going back to not using, since they make life a lot eaiser and better when it comes to working in files.
### Tabs:
There has been added remaps for tabs, <leader>ct creates a new tab, <leader>qt closes a tab. If you are in netrw you can press t on a file to open it in a tab.
You can jump between tabs with gt, if you want to jump to a spesific tab you can use fx 2gt, to go to tab 2
### Just a friendly reminder
It might be required to go above neovin version 0.10.0, as I have seen some funny errors with the LSP config, so to be safe if you have to option, go with version 0.11.0 or later as that just seams to work

1
ftdetect/ansible.vim Normal file
View File

@@ -0,0 +1 @@
au BufRead,BufNewFile *.yml set filetype=yaml.ansible

View File

@@ -31,6 +31,8 @@ return {
"terraformls",
"pylsp",
"bashls",
"docker_compose_language_service",
"dockerls",
},
handlers = {
function(server_name) -- default handler (optional)
@@ -51,12 +53,12 @@ return {
executionEnvironment = { enabled = false },
validation = {
enabled = false,
-- lint = { enabled = true, path = 'ansible-lint' },
lint = { enabled = true, path = 'ansible-lint' },
},
},
},
filetypes = { 'yaml', 'yml', 'ansible' },
root_dir = lspconfig.util.root_pattern("roles", "playbooks", "Documents"),
root_dir = lspconfig.util.root_pattern("roles", "playbooks"),
single_file_support = false,
})
end,
@@ -71,16 +73,6 @@ return {
})
end,
["terraformls"] = function ()
local lspconfig = require("lspconfig")
lspconfig["terraformls"].setup({
cmd = {"terraform-ls", "server"},
filetypes = { 'terraform', 'terraform-vars', 'tf', 'hcl' },
root_dir = lspconfig.util.root_pattern("Documents"),
single_file_support = false,
})
end,
["bashls"] = function ()
local lspconfig = require("lspconfig")
lspconfig["bashls"].setup({

View File

@@ -12,10 +12,9 @@ return {
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>pf', builtin.find_files, {}) -- Lets you find files
vim.keymap.set('n', '<C-p>', builtin.git_files, {}) -- lets you find git files
vim.keymap.set('n', '<leader>ps', function() -- Lets you grep for a string
builtin.grep_string({ search = vim.fn.input("Grep > ") })
end)
vim.keymap.set('n', '<leader>vh', builtin.help_tags, {})
end
}
}

View File

@@ -6,7 +6,7 @@ return {
require("nvim-treesitter.configs").setup({
-- A list of parser names, or "all"
ensure_installed = {
"vimdoc", "lua", "bash", "yaml", "terraform", "hcl", "python",
"vimdoc", "lua", "bash", "yaml", "terraform", "hcl", "python", "dockerfile",
},
-- Install parsers synchronously (only applied to `ensure_installed`)

View File

@@ -1,8 +1,13 @@
-- For some reason the lua lsp thinks that vim. is a undefined global :| just ignore when it tells you lies.
-- Settings leader as space. Leader is requred for all custom keybinds
vim.g.mapleader = " "
-- Enters netrw/file explore in nvim
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
-- Creating keybinds for using tabs
vim.keymap.set("n", "<leader>ct", vim.cmd.tabnew)
vim.keymap.set("n", "<leader>qt", vim.cmd.tabclose)
-- Lests you move visual marked blocks up and down
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
@@ -24,4 +29,4 @@ vim.keymap.set("n", "<leader>Y", [["+Y]])
-- Ctrl-c remap to Esc
vim.keymap.set("i", "<C-c>", "<Esc>")
vim.keymap.set("n", "Q", "<nop>")
vim.keymap.set("n", "Q", "<nop>")

View File

@@ -4,6 +4,7 @@ vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.swapfile = false
vim.opt.smartindent = true

27
nvim_keybinds_cheatsheet Normal file
View File

@@ -0,0 +1,27 @@
Here is a list of the configured keybinds and what they do.
Now keep in mind, most of the keybinds are just standard vi/vim keybinds, therefor if you are wondering how to do things, try the default vi/vim keybinds first.
Finding files and file browsing
space+p+v: This sends you out into netrw where you can navigate between files and directoris.
space+p+f: This will open a prompt where you can search for file names, there is also a file preview.
space+p+s: This will open a grep search bar at the bottom of the nvim window where you can search for thigs in files, it will then open a windows where you can see all the files that contain what you have searched for.
Editing files
space+y: This lets you yoink into clipboard instead of the nvim buffer
space+p: This will let you paste from the nvim yoink buffer without overwriting it
ctrl+v: This puts you into a visual block
ctrl+y: This accepts the highlighted option in the auto complete box
ctrl+c: This has been mapped to esc
ctrl+w+d: This will show why there is a error or a warning
Using taps
space+c+t: This will open a new tap
space+q+t: This will close the tap you are in
space+g+t: This will go to the next tap
space+(number)+g+t: This will send you to the tap with you number you selected
Managing plugins and language servers
:Lazy (this will open the plugin manager window)
:Mason (This will open the lsp manager window)