nvim plugins & hyprland bindings

This commit is contained in:
Brieuc Dubois 2024-03-23 14:36:40 +01:00
parent 0a4e183bf5
commit 0cc4ce2e14
5 changed files with 121 additions and 33 deletions

View File

@ -1 +1,6 @@
{"dependencies":{}}
{
"dependencies": {
"coc-json": ">=1.9.2",
"coc-tsserver": ">=2.1.4"
}
}

View File

@ -42,6 +42,10 @@ bind = $mainMod SHIFT, underscore, movetoworkspace, 8
bind = $mainMod SHIFT, ccedilla, movetoworkspace, 9
bind = $mainMod SHIFT, agrave, movetoworkspace, 10
# Move active workspace to neighboring monitor with mainMod + SHIFT + arrow keys
bind = $mainMod SHIFT, left, movecurrentworkspacetomonitor, l
bind = $mainMod SHIFT, right, movecurrentworkspacetomonitor, r
# Example special workspace (scratchpad)
bind = $mainMod, S, togglespecialworkspace, magic
bind = $mainMod SHIFT, S, movetoworkspace, special:magic

View File

@ -85,8 +85,3 @@ misc {
force_default_wallpaper = -1 # Set to 0 or 1 to disable the anime mascot wallpapers
}
# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
device:epic-mouse-v1 {
sensitivity = -0.5
}

View File

@ -1,3 +1,2 @@
windowrulev2 = idleinhibit fullscreen, fullscreen:1
windowrulev2 = tile, class:^(ONLYOFFICE Desktop Editors)$
windowrulev2 = nomaximizerequest, class:.*

View File

@ -14,42 +14,127 @@ vim.opt.expandtab = false
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.wildmode = 'longest,list'
vim.opt.wildmode = "longest,list"
vim.opt.syntax = 'on'
vim.opt.syntax = "on"
vim.opt.ttyfast = true
vim.opt.swapfile = false
vim.opt.mouse = 'a'
vim.opt.mouse = "a"
vim.opt.spell = true
vim.opt.spelllang = 'en' -- ,fr'
vim.api.nvim_set_hl(0, "SpellBad", { ctermbg=238 })
vim.opt.spelllang = "en" -- ,fr'
vim.api.nvim_set_hl(0, "SpellBad", { ctermbg = 238 })
vim.cmd([[colorscheme desert]])
-- Plugins
local Plug = vim.fn['plug#']
vim.call('plug#begin')
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
Plug('neoclide/coc.nvim', {['branch'] = 'release'})
Plug('francoiscabrol/ranger.vim')
Plug('rbgrouleff/bclose.vim')
-- Plug('zbirenbaum/copilot.lua')
Plug('github/copilot.vim')
Plug('nvim-treesitter/nvim-treesitter', {['do'] = ':TSUpdate'})
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
"--depth=1",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
vim.call('plug#end')
require("lazy").setup({
{
-- Auto completion
"neoclide/coc.nvim",
branch = "release",
},
{
-- LSP
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
},
{
-- Copilot
"github/copilot.vim",
--config = function()
-- require("copilot.vim").setup({
-- filetypes = {
-- ["."] = true,
-- }
-- })
-- end,
},
{
-- Ranger file explorer
"kelly-lin/ranger.nvim",
config = function()
require("ranger-nvim").setup({ replace_netrw = true })
end,
},
{
-- Formatter
"stevearc/conform.nvim",
opts = {},
},
{
-- Auto pairs
"altermo/ultimate-autopair.nvim",
event = { "InsertEnter", "CmdlineEnter" },
branch = "v0.6", --recommended as each new version will have breaking changes
opts = {},
},
})
-- inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
-- \: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
require("conform").setup({
formatters_by_ft = {
lua = { "stylua" },
python = { "black" },
javascript = { "prettier" },
typescript = { "prettier" },
svelte = { "prettier" },
html = { "prettier" },
css = { "prettier" },
md = { "prettier" },
less = { "prettier" },
scss = { "prettier" },
json = { "prettier" },
yaml = { "prettier" },
toml = { "prettier" },
java = { "google-java-format" },
},
format_on_save = {},
})
vim.g.ranger_replace_netrw = 1
vim.keymap.set('i', '<C-Right>', '<Plug>(copilot-accept-word)')
require('nvim-treesitter.configs').setup({
ensure_installed = { "go", "lua", "vim", "vimdoc", "sql", "json", },
require("nvim-treesitter.configs").setup({
ensure_installed = { "go", "lua", "vim", "vimdoc", "sql", "json", "javascript", "typescript", "svelte", "html", "java", "markdown" },
highlight = {
enable = true,
},
autotag = {
enable = true,
},
})
-- mappings
vim.keymap.set("i", "<C-Right>", "<Plug>(copilot-accept-word)")
vim.keymap.set(
"i",
"<CR>",
"coc#pum#visible() ? coc#pum#next(1): '<CR>'",
{ noremap = true, silent = true, expr = true }
)
-- commands
vim.api.nvim_create_user_command("Day", function(opts)
vim.cmd([[colorscheme delek]])
end, { nargs = 0 })
vim.api.nvim_create_user_command("Night", function(opts)
vim.cmd([[colorscheme desert]])
end, { nargs = 0 })
-- Abc