Compare commits
	
		
			3 Commits
		
	
	
		
			333ea49d45
			...
			adf023f322
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | adf023f322 | ||
|  | 3583d1df2b | ||
|  | b3a4fe9053 | 
| @@ -8,8 +8,12 @@ vim.api.nvim_create_autocmd( | |||||||
|  |  | ||||||
|       -- Vim settings |       -- Vim settings | ||||||
|  |  | ||||||
|       vim.opt.signcolumn = "auto" |       vim.opt_local.signcolumn = 'auto' | ||||||
|       vim.opt.foldcolumn = "auto" |       vim.opt_local.foldcolumn = 'auto' | ||||||
|  |       vim.opt_local.makeprg = 'groovy %' | ||||||
|  |       vim.keymap.set({ 'n', 'i', 'v' }, '<F5>', ':make<CR>', { buffer = true }) | ||||||
|  |       -- vim.keymap.nnoremap { '<leader>²x', ':make<CR>' } | ||||||
|  |       -- vim.keymap.inoremap { '<leader>²x', '<ESC>:make<CR>' } | ||||||
|  |  | ||||||
|       -- Terminal settings |       -- Terminal settings | ||||||
|  |  | ||||||
| @@ -19,6 +23,7 @@ vim.api.nvim_create_autocmd( | |||||||
|       local command = " groovysh" |       local command = " groovysh" | ||||||
|       local direction = "horizontal" |       local direction = "horizontal" | ||||||
|       local size = 25 |       local size = 25 | ||||||
|  |       local toggle_key = "<F10>" | ||||||
|  |  | ||||||
|       -- Define a new terminal dedicated to groovy |       -- Define a new terminal dedicated to groovy | ||||||
|       local toggleterm = require('toggleterm') |       local toggleterm = require('toggleterm') | ||||||
| @@ -46,44 +51,46 @@ vim.api.nvim_create_autocmd( | |||||||
|       -- -- Define a function to run code from current buffer in the terminal |       -- -- Define a function to run code from current buffer in the terminal | ||||||
|       -- function _Groovy_buffer_exec() |       -- function _Groovy_buffer_exec() | ||||||
|       --   if not groovy:is_open() then groovy:open(size, direction) end |       --   if not groovy:is_open() then groovy:open(size, direction) end | ||||||
|       --   groovy:open(size, direction) |  | ||||||
|       --   groovy:send(' clear', true) |       --   groovy:send(' clear', true) | ||||||
|       --   groovy:send(command, true) |       --   groovy:send(command, true) | ||||||
|       -- end |       -- end | ||||||
|  |  | ||||||
|       -- |       -- | ||||||
|       -- Define a function to run code from visual selection in the terminal |       -- Define a function to run code from visual selection in the terminal | ||||||
|       -- function _Groovy_visual_exec(args) |       function _Groovy_visual_exec() | ||||||
|       --   groovy:open(size, direction) |         if not groovy:is_open() then groovy:open(size, direction) end | ||||||
|       --   toggleterm.send_lines_to_terminal("visual_lines", true, { groovy.id }) |         toggleterm.send_lines_to_terminal("visual_lines", true, { groovy.id }) | ||||||
|       -- end |       end | ||||||
|  |  | ||||||
|       -- Define a keymap to run the current buffer in the terminal |       -- Define a keymap to run the current buffer in the terminal | ||||||
|       --   <F10> corresponds to         F10 on my keyboard |       --   <F10> corresponds to         F10 on my keyboard | ||||||
|       --   <F22> corresponds to Shift + F10 on my keyboard |       --   <F22> corresponds to Shift + F10 on my keyboard | ||||||
|       --   <F34> corresponds to Ctrl  + F10 on my keyboard |       --   <F34> corresponds to Ctrl  + F10 on my keyboard | ||||||
|       vim.api.nvim_set_keymap("n", "<F10>", |       vim.keymap.set({ 'n', 'i', 'v', 't' }, '<F10>', function() groovy:toggle(size, direction) end, | ||||||
|         "<cmd>lua _Groovy_terminal_toggle()<cr>", |  | ||||||
|         { noremap = true, silent = true }) |  | ||||||
|       vim.api.nvim_set_keymap("i", "<F10>", |  | ||||||
|         "<cmd>lua _Groovy_terminal_toggle()<cr>", |  | ||||||
|         { noremap = true, silent = true }) |  | ||||||
|       vim.api.nvim_set_keymap("v", "<F10>", |  | ||||||
|         "<cmd>lua _Groovy_terminal_toggle()<cr>", |  | ||||||
|         { noremap = true, silent = true }) |  | ||||||
|       vim.api.nvim_set_keymap("t", "<F10>", |  | ||||||
|         "<cmd>lua _Groovy_terminal_toggle()<cr>", |  | ||||||
|         { noremap = true, silent = true }) |         { noremap = true, silent = true }) | ||||||
|  |  | ||||||
|  |       -- vim.api.nvim_set_keymap("n", toggle_key, | ||||||
|  |       --   "<cmd>lua _Groovy_terminal_toggle()<cr>", | ||||||
|  |       --   { noremap = true, silent = true }) | ||||||
|  |       -- vim.api.nvim_set_keymap("i", toggle_key, | ||||||
|  |       --   "<cmd>lua _Groovy_terminal_toggle()<cr>", | ||||||
|  |       --   { noremap = true, silent = true }) | ||||||
|  |       -- vim.api.nvim_set_keymap("v", toggle_key, | ||||||
|  |       --   "<cmd>lua _Groovy_terminal_toggle()<cr>", | ||||||
|  |       --   { noremap = true, silent = true }) | ||||||
|  |       -- vim.api.nvim_set_keymap("t", toggle_key, | ||||||
|  |       --   "<cmd>lua _Groovy_terminal_toggle()<cr>", | ||||||
|  |       --   { noremap = true, silent = true }) | ||||||
|  |  | ||||||
|       -- vim.api.nvim_set_keymap("n", "<F22>", |       -- vim.api.nvim_set_keymap("n", "<F22>", | ||||||
|       --   '<cmd>lua _Groovy_visual_exec()<cr>', |       --   '<cmd>lua _Groovy_visual_exec()<cr>', | ||||||
|       --   { noremap = true, silent = true }) |       --   { noremap = true, silent = true }) | ||||||
|       -- vim.api.nvim_set_keymap("i", "<F22>", |       -- vim.api.nvim_set_keymap("i", "<F22>", | ||||||
|       --   '<cmd>lua _Groovy_visual_exec()<cr>', |       --   '<cmd>lua _Groovy_visual_exec()<cr>', | ||||||
|       --   { noremap = true, silent = true }) |       --   { noremap = true, silent = true }) | ||||||
|       -- vim.api.nvim_set_keymap("v", "<F22>", |       vim.api.nvim_set_keymap("v", "<F22>", | ||||||
|       --   "<cmd>lua _Groovy_visual_exec()<cr>", |         "<cmd>lua _Groovy_visual_exec()<cr>", | ||||||
|       --   { noremap = true, silent = true }) |         { noremap = true, silent = true }) | ||||||
|  |  | ||||||
|       -- vim.api.nvim_set_keymap("n", "<F34>", |       -- vim.api.nvim_set_keymap("n", "<F34>", | ||||||
|       --   '<cmd>lua _Groovy_buffer_exec()<cr>', |       --   '<cmd>lua _Groovy_buffer_exec()<cr>', | ||||||
|   | |||||||
| @@ -8,9 +8,8 @@ vim.api.nvim_create_autocmd( | |||||||
|  |  | ||||||
|       -- Vim settings |       -- Vim settings | ||||||
|  |  | ||||||
|       vim.opt.signcolumn = "auto" |       vim.opt_local.signcolumn = "auto" | ||||||
|       vim.opt.foldcolumn = "auto" |       vim.opt_local.foldcolumn = "auto" | ||||||
|  |  | ||||||
|  |  | ||||||
|       -- Terminal settings |       -- Terminal settings | ||||||
|  |  | ||||||
|   | |||||||
| @@ -14,6 +14,7 @@ return { | |||||||
|     -- ["<C-s>"] = { ":w!<cr>", desc = "Save File" },  -- change description but the same command |     -- ["<C-s>"] = { ":w!<cr>", desc = "Save File" },  -- change description but the same command | ||||||
|  |  | ||||||
|     -- My telescope keybindings |     -- My telescope keybindings | ||||||
|  |     ["<F1>"] = { "<cmd>Telescope help_tags<cr>", desc = "Find help with Telescope" }, | ||||||
|     ["<leader>gf"] = { "<cmd>Telescope git_files<cr>", desc = "Find git files with Telescope" }, |     ["<leader>gf"] = { "<cmd>Telescope git_files<cr>", desc = "Find git files with Telescope" }, | ||||||
|     ["<leader>fq"] = { "<cmd>Telescope quickfix<cr>", desc = "Find quickfixes with Telescope" }, |     ["<leader>fq"] = { "<cmd>Telescope quickfix<cr>", desc = "Find quickfixes with Telescope" }, | ||||||
|     ["<leader>fs"] = { "<cmd>Telescope spell_suggest<cr>", desc = "Find spell suggestions with Telescope" }, |     ["<leader>fs"] = { "<cmd>Telescope spell_suggest<cr>", desc = "Find spell suggestions with Telescope" }, | ||||||
| @@ -29,17 +30,17 @@ return { | |||||||
|     ["<leader>²nb"] = { "<cmd>Neotree toggle buffers left<cr>", desc = "Open Neotree Buffers" }, |     ["<leader>²nb"] = { "<cmd>Neotree toggle buffers left<cr>", desc = "Open Neotree Buffers" }, | ||||||
|     ["<leader>²ng"] = { "<cmd>Neotree toggle git_status left<cr>", desc = "Open Neotree Git status" }, |     ["<leader>²ng"] = { "<cmd>Neotree toggle git_status left<cr>", desc = "Open Neotree Git status" }, | ||||||
|  |  | ||||||
|     ["<F26>"] = { '<cmd>Neotree toggle<cr>', desc = "File Explorer" },                                     -- F26 corresponds to <Ctrl+F2> on my keyboard |     ["<F2>"] = { '<cmd>Neotree toggle<cr>', desc = "File Explorer" },                                              -- F26 corresponds to <Ctrl+F2> on my keyboard | ||||||
|     ["<F27>"] = { function() require("astronvim.utils").toggle_term_cmd "lazygit" end, desc = "Lazygit" }, -- F27 corresponds to <Ctrl+F3> on my keyboard |     ["<F3>"] = { function() require("astronvim.utils").toggle_term_cmd "lazygit" end, desc = "Lazygit terminal" }, -- F27 corresponds to <Ctrl+F3> on my keyboard | ||||||
|     ["<F28>"] = { function() require("astronvim.utils").toggle_term_cmd "tig" end, desc = "Tig" },         -- F28 corresponds to <Ctrl+F4> on my keyboard |     ["<F4>"] = { function() require("astronvim.utils").toggle_term_cmd "tig" end, desc = "Tig terminal" },         -- F28 corresponds to <Ctrl+F4> on my keyboard | ||||||
|   }, |   }, | ||||||
|  |  | ||||||
|  |  | ||||||
|   -- Insert mode |   -- Insert mode | ||||||
|   i = { |   i = { | ||||||
|     ["<F26>"] = { '<cmd>Neotree toggle<cr>', desc = "File Explorer" },                                     -- F26 corresponds to <Ctrl+F2> on my keyboard |     ["<F2>"] = { '<cmd>Neotree toggle<cr>', desc = "File Explorer" },                                              -- F26 corresponds to <Ctrl+F2> on my keyboard | ||||||
|     ["<F27>"] = { function() require("astronvim.utils").toggle_term_cmd "lazygit" end, desc = "Lazygit" }, -- F27 corresponds to <Ctrl+F3> on my keyboard |     ["<F3>"] = { function() require("astronvim.utils").toggle_term_cmd "lazygit" end, desc = "Lazygit terminal" }, -- F27 corresponds to <Ctrl+F3> on my keyboard | ||||||
|     ["<F28>"] = { function() require("astronvim.utils").toggle_term_cmd "tig" end, desc = "Tig" },         -- F28 corresponds to <Ctrl+F4> on my keyboard |     ["<F4>"] = { function() require("astronvim.utils").toggle_term_cmd "tig" end, desc = "Tig terminal" },         -- F28 corresponds to <Ctrl+F4> on my keyboard | ||||||
|   }, |   }, | ||||||
|  |  | ||||||
|   -- Terminal mode |   -- Terminal mode | ||||||
| @@ -54,7 +55,8 @@ return { | |||||||
|     -- Clear Ctrl-J and Ctrl-K so that we can use them to navigate the terminal (for lazygit) |     -- Clear Ctrl-J and Ctrl-K so that we can use them to navigate the terminal (for lazygit) | ||||||
|     ["<C-j>"] = false, |     ["<C-j>"] = false, | ||||||
|     ["<C-k>"] = false, |     ["<C-k>"] = false, | ||||||
|     ["<F27>"] = { function() require("astronvim.utils").toggle_term_cmd "lazygit" end, desc = "Lazygit" }, -- F27 corresponds to <Ctrl+F3> on my keyboard |     -- My terms | ||||||
|     ["<F28>"] = { function() require("astronvim.utils").toggle_term_cmd "tig" end, desc = "Tig" },         -- F28 corresponds to <Ctrl+F4> on my keyboard |     ["<F3>"] = { function() require("astronvim.utils").toggle_term_cmd "lazygit" end, desc = "Lazygit terminal" }, -- F27 corresponds to <Ctrl+F3> on my keyboard | ||||||
|  |     ["<F4>"] = { function() require("astronvim.utils").toggle_term_cmd "tig" end, desc = "Tig terminal" },         -- F28 corresponds to <Ctrl+F4> on my keyboard | ||||||
|   }, |   }, | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,13 +1,19 @@ | |||||||
| -- set vim options here (vim.<first_key>.<second_key> = value) | -- set vim options here (vim.<first_key>.<second_key> = value) | ||||||
| return { | return { | ||||||
|   opt = { |   opt = { | ||||||
|     relativenumber = false, -- sets vim.opt.relativenumber |  | ||||||
|     cmdheight = 1, |     cmdheight = 1, | ||||||
|  |  | ||||||
|     scrolloff = 0,          -- Set scroll offset to zero so that zt and zb work as expected |     scrolloff = 0,          -- Set scroll offset to zero so that zt and zb work as expected | ||||||
|     -- spell = false,         -- sets vim.opt.spell |  | ||||||
|  |     number = true,          -- sets vim.opt.number | ||||||
|  |     relativenumber = false, -- sets vim.opt.relativenumber | ||||||
|  |  | ||||||
|  |     signcolumn = "auto",    -- sets vim.opt.signcolumn to auto | ||||||
|  |     foldcolumn = "auto",    -- sets vim.opt.foldcolumn to auto | ||||||
|  |  | ||||||
|     spelllang = "fr",       -- Set spell language to french |     spelllang = "fr",       -- Set spell language to french | ||||||
|     -- number = true,         -- sets vim.opt.number |     -- spell = false,         -- sets vim.opt.spell | ||||||
|     -- signcolumn = "auto",   -- sets vim.opt.signcolumn to auto |  | ||||||
|     -- wrap = false,          -- sets vim.opt.wrap |     -- wrap = false,          -- sets vim.opt.wrap | ||||||
|   }, |   }, | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user