From 3391bad79acc26219fd8ebebe36eee9971afb6d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Meukens?= Date: Wed, 7 Feb 2024 18:43:43 +0100 Subject: [PATCH] removed neovim --- home/default.nix | 3 -- home/neovim/coc.nix | 12 ------ home/neovim/config.lua | 33 --------------- home/neovim/default.nix | 86 --------------------------------------- home/neovim/haskell.nix | 33 --------------- home/neovim/telescope.nix | 53 ------------------------ home/neovim/which-key.nix | 26 ------------ 7 files changed, 246 deletions(-) delete mode 100644 home/neovim/coc.nix delete mode 100644 home/neovim/config.lua delete mode 100644 home/neovim/default.nix delete mode 100644 home/neovim/haskell.nix delete mode 100644 home/neovim/telescope.nix delete mode 100644 home/neovim/which-key.nix diff --git a/home/default.nix b/home/default.nix index 840fbfe..fedffd4 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,11 +1,8 @@ { flake, ... }: { imports = [ - # This loads ./neovim/default.nix - neovim configured for Haskell dev, and other things. - ./neovim ./starship.nix ./terminal.nix - # Add more of your home-manager modules here. ]; # Recommended Nix settings diff --git a/home/neovim/coc.nix b/home/neovim/coc.nix deleted file mode 100644 index ae18bc3..0000000 --- a/home/neovim/coc.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, ... }: -{ - programs.neovim = { - coc = { - enable = true; - }; - - extraPackages = [ - pkgs.nodejs # coc requires nodejs - ]; - }; -} diff --git a/home/neovim/config.lua b/home/neovim/config.lua deleted file mode 100644 index a10515f..0000000 --- a/home/neovim/config.lua +++ /dev/null @@ -1,33 +0,0 @@ --- ------- --- Library --- ------- - -function map (mode, shortcut, command) -vim.api.nvim_set_keymap(mode, shortcut, command, { noremap = true, silent = true }) -end -function nmap(shortcut, command) -map('n', shortcut, command) -end -function imap(shortcut, command) -map('i', shortcut, command) -end - --- ------ --- Config --- ------ - -vim.cmd([[ -set nobackup -set number -set termguicolors " 24-bit colors -" let g:tokyonight_style = "day" -" let g:tokyonight_italic_functions = 1 -colorscheme PaperColor -]]) - --- I don't care about tabs. -vim.opt.tabstop = 2 -vim.opt.shiftwidth = 2 -vim.opt.expandtab = true - - diff --git a/home/neovim/default.nix b/home/neovim/default.nix deleted file mode 100644 index e0f6474..0000000 --- a/home/neovim/default.nix +++ /dev/null @@ -1,86 +0,0 @@ -{ pkgs, ... }: -{ - imports = [ - ./telescope.nix - ./coc.nix - ./haskell.nix - # which-key must be the last import for it to recognize the keybindings of - # previous imports. - ./which-key.nix - ]; - programs.neovim = { - enable = true; - - extraPackages = [ - pkgs.lazygit - ]; - - # Full list here, - # https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/generated.nix - plugins = with pkgs.vimPlugins; [ - # Status bar for vim - - # For working mouse support when running inside tmux - terminus - - { - plugin = lazygit-nvim; - type = "lua"; - config = '' - nmap("gg", ":LazyGit") - ''; - } - - (nvim-treesitter.withPlugins (_: pkgs.tree-sitter.allGrammars)) - # Preferred theme - tokyonight-nvim - papercolor-theme - - # File browser - { - plugin = nvim-tree-lua; - type = "lua"; - config = '' - require("nvim-tree").setup() - ''; - } - nvim-web-devicons - - { - plugin = lualine-nvim; - type = "lua"; - config = '' - require('lualine').setup { - options = { - theme = 'tokyonight' - } - } - ''; - } - - # Buffer tabs - { - plugin = bufferline-nvim; - type = "lua"; - config = '' - require("bufferline").setup{ } - nmap("b", ":BufferLineCycleNext") - nmap("B", ":BufferLineCyclePrev") - ''; - } - - # Language support - vim-nix - - vim-markdown - ]; - - # Add library code here for use in the Lua config from the - # plugins list above. - extraConfig = '' - lua << EOF - ${builtins.readFile ./config.lua} - EOF - ''; - }; -} diff --git a/home/neovim/haskell.nix b/home/neovim/haskell.nix deleted file mode 100644 index 0393802..0000000 --- a/home/neovim/haskell.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ pkgs, ... }: -{ - programs.neovim = { - coc.settings.languageserver.haskell = { - command = "haskell-language-server-wrapper"; - args = [ "--lsp" ]; - rootPatterns = [ - "*.cabal" - "cabal.project" - "hie.yaml" - ]; - filetypes = [ "haskell" "lhaskell" ]; - }; - - plugins = with pkgs.vimPlugins; [ - { - plugin = haskell-vim; - type = "lua"; - config = '' - vim.cmd([[ - let g:haskell_enable_quantification = 1 " to enable highlighting of `forall` - let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec` - let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc` - let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern` - let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles - let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static` - ]]) - ''; - } - ]; - - }; -} diff --git a/home/neovim/telescope.nix b/home/neovim/telescope.nix deleted file mode 100644 index 3355788..0000000 --- a/home/neovim/telescope.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ pkgs, ... }: -{ - programs.neovim = { - plugins = with pkgs.vimPlugins; [ - { - plugin = telescope-nvim; - type = "lua"; - config = '' - nmap("ff", ":Telescope find_files") - nmap("fg", ":Telescope live_grep") - nmap("fb", ":Telescope buffers") - nmap("fh", ":Telescope help_tags") - ''; - } - { - plugin = telescope-zoxide; - type = "lua"; - config = '' - nmap("fz", ":Telescope zoxide list") - ''; - } - { - plugin = telescope-file-browser-nvim; - type = "lua"; - config = '' - -- You don't need to set any of these options. - -- IMPORTANT!: this is only a showcase of how you can set default options! - require("telescope").setup { - extensions = { - file_browser = { - theme = "ivy", - mappings = { - ["i"] = { - -- your custom insert mode mappings - }, - ["n"] = { - -- your custom normal mode mappings - }, - }, - }, - }, - } - -- To get telescope-file-browser loaded and working with telescope, - -- you need to call load_extension, somewhere after setup function: - require("telescope").load_extension "file_browser" - nmap("fb", ":Telescope file_browser path=%:p:h") - nmap("fB", ":Telescope file_browser") - ''; - } - - ]; - }; -} diff --git a/home/neovim/which-key.nix b/home/neovim/which-key.nix deleted file mode 100644 index 680aef2..0000000 --- a/home/neovim/which-key.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ pkgs, ... }: -{ - programs.neovim = { - plugins = with pkgs.vimPlugins; [ - # Doom-emacs like experience - { - plugin = vim-which-key; - type = "lua"; - # TODO: How to port this to Lua? - config = '' - vim.cmd([[ - map - let g:mapleader = "\" - let g:maplocalleader = ',' - nnoremap :WhichKey '' - nnoremap :WhichKey ',' - ]]) - ''; - } - # TODO: Don't know how to configure this correctly - # nvim-whichkey-setup-lua - - - ]; - }; -}