Bobinas P4G
  • Login
  • Public

    • Public
    • Groups
    • Popular
    • People

Conversation

Notices

  1. Bernie (codewiz@mstdn.io)'s status on Sunday, 21-Nov-2021 21:43:16 UTC Bernie Bernie

    Another week, another plugin manager for vim...
    https://github.com/wbthomason/packer.nvim

    This one is written in #Lua and makes use of newly-added #neovim features... but is it worth the time to switch? VimPlug works just fine...

    In conversation Sunday, 21-Nov-2021 21:43:16 UTC from mstdn.io permalink

    Attachments


    • Bernie (codewiz@mstdn.io)'s status on Sunday, 21-Nov-2021 22:03:02 UTC Bernie Bernie
      in reply to
      • Hunter Jozwiak

      @sektor Hmm...
      vi started off as a visual frontend for the UNIX line editor "ed". This is where vim's ":" prompt comes from, and the motion commands are still the same.

      vim today still supports an "ex" mode, which is an extended version of ed.

      And I bet a non-visual editor integrates better with screen readers... but you tell me.

      In conversation Sunday, 21-Nov-2021 22:03:02 UTC permalink
    • Hunter Jozwiak (sektor@itmslaves.com)'s status on Sunday, 21-Nov-2021 22:03:03 UTC Hunter Jozwiak Hunter Jozwiak
      in reply to

      @codewiz I should get off my lazy ass and actually see if I can figure out how to get the screenreader to read the vim properly. If I press h, j, k, l nothing is read, but the arrow keys read things just fine.

      In conversation Sunday, 21-Nov-2021 22:03:03 UTC permalink
    • Bernie (codewiz@mstdn.io)'s status on Sunday, 21-Nov-2021 22:09:55 UTC Bernie Bernie
      in reply to
      • Hunter Jozwiak

      By the way, ed was surprisingly powerful: Ken Thompson and Dennis Ritchie wrote all of UNIX and its C compiler on a tty. Not the modern vt100 terminals with a CRT - I mean the real paper typewriter thing!

      This explains why C and the UNIX shell had to be so terse... ๐Ÿ˜‚

      But are there screen readers for programmers that do a good job reading C and Bash aloud?

      @sektor

      In conversation Sunday, 21-Nov-2021 22:09:55 UTC permalink
    • Bernie (codewiz@mstdn.io)'s status on Sunday, 21-Nov-2021 22:18:51 UTC Bernie Bernie
      in reply to
      • Hunter Jozwiak

      @sektor I've never really used ex, but I think you can't just move around with the cursor keys...

      It prints lines when you type a line number, and I haven't figured out how to print a range of lines ๐Ÿ˜…

      In conversation Sunday, 21-Nov-2021 22:18:51 UTC permalink
    • Hunter Jozwiak (sektor@itmslaves.com)'s status on Sunday, 21-Nov-2021 22:18:52 UTC Hunter Jozwiak Hunter Jozwiak
      in reply to

      @codewiz Orca does a decent job in the GUI, with fenrir being an awesome CLI screenreader. I tried the Ex mode, and as I move the lines it says only the line number. I wonder if it is passing the arrow through to the operating system.

      In conversation Sunday, 21-Nov-2021 22:18:52 UTC permalink
    • Bernie (codewiz@mstdn.io)'s status on Sunday, 21-Nov-2021 22:19:45 UTC Bernie Bernie
      in reply to
      • Hunter Jozwiak

      @sektor Ah, well, it uses comma, just like vi:
      https://www.cs.ait.ac.th/~on/O/oreilly/unix/vi/ch05_01.htm

      In conversation Sunday, 21-Nov-2021 22:19:45 UTC permalink

      Attachments

      1. Learning the vi Editor
        from Linda Lamb
    • Bernie (codewiz@mstdn.io)'s status on Sunday, 21-Nov-2021 23:05:25 UTC Bernie Bernie
      in reply to

      I actually tried out Packer and converted my neovim-only plugins from Plugger to Packer. It's not bad!

      Until #neovim replaces the classic #vim in most Linux distros, I want my .vimrc to work on both, so I am not going to convert everything to Lua.

      And so I ended up with two competing plugin managers in my text editor ๐Ÿ˜…

      In conversation Sunday, 21-Nov-2021 23:05:25 UTC permalink
    • Bernie (codewiz@mstdn.io)'s status on Sunday, 21-Nov-2021 23:05:39 UTC Bernie Bernie
      in reply to
      • Srevin Saju

      @srevinsaju, do you use Packer?

      In conversation Sunday, 21-Nov-2021 23:05:39 UTC permalink
    • Bernie (codewiz@mstdn.io)'s status on Monday, 22-Nov-2021 00:47:47 UTC Bernie Bernie
      in reply to

      Next, after freaking out at coq.nvim's complexity (it needs python3-venv and sqlite), I installed vim-cmp, which is entirely written in #Lua, and thus doesn't require compiling:
      https://github.com/hrsh7th/nvim-cmp

      #vim #neovim #programming

      In conversation Monday, 22-Nov-2021 00:47:47 UTC permalink

      Attachments

      1. GitHub - hrsh7th/nvim-cmp: A completion plugin for neovim coded in Lua.
        A completion plugin for neovim coded in Lua. Contribute to hrsh7th/nvim-cmp development by creating an account on GitHub.
    • Bernie (codewiz@mstdn.io)'s status on Monday, 22-Nov-2021 00:58:17 UTC Bernie Bernie
      in reply to

      One thing I didn't initially understand is that #Neovim's built-in LSP client isn't enough to get autocmpletion!

      First, you need to configure which Language Server should be spawned for each file type you open. For this, there's nvim-lspconfig, which is maintained by the Neovim devs as a separate project:
      https://github.com/neovim/nvim-lspconfig

      But wait! The LSP configuration needs to be configured... in Lua, of course! And don't forget to define some mappings for "Go To Definition" etc...

      In conversation Monday, 22-Nov-2021 00:58:17 UTC permalink

      Attachments


    • Bernie (codewiz@mstdn.io)'s status on Monday, 22-Nov-2021 01:11:37 UTC Bernie Bernie
      in reply to

      Do we have #Rust completion yet? Not so fast!

      You see, #Neovim has builtin completion, but what you really want for programming is *autocompletion*, which requires an external plugin:
      https://github.com/neovim/nvim-lspconfig/wiki/Autocompletion#autocompletion-not-built-in-vs-completion-built-in

      It says nvim-cmp is the recommended plugin, so it will be easy to integrate, right?

      Easy peasy! My nvim-cmp configuration is only... 73 lines of #Lua config!

      In conversation Monday, 22-Nov-2021 01:11:37 UTC permalink

      Attachments

      1. Autocompletion ยท neovim/nvim-lspconfig Wiki
        Quickstart configurations for the Nvim LSP client. Contribute to neovim/nvim-lspconfig development by creating an account on GitHub.
    • Bernie (codewiz@mstdn.io)'s status on Monday, 22-Nov-2021 01:21:11 UTC Bernie Bernie
      in reply to

      I copy-pasted most of the config, and when it breaks I'm not quite sure how to debug it.

      In fact, it's not working right now. If I open a Rust project and start typing, I get plenty of useless snippets instead of the semantic completion. I see rust-analyzer running and eating CPU time... I even see inline errors... so why?

      Why do I have to learn #Lua before I can code in #Rust?

      WHYYYY?!?! ๐Ÿ˜ฉ

      In conversation Monday, 22-Nov-2021 01:21:11 UTC permalink
    • Bernie (codewiz@mstdn.io)'s status on Monday, 22-Nov-2021 01:29:28 UTC Bernie Bernie
      in reply to

      Hey, it seems I gave up too fast!

      My semantic completions were already in the menu, just BELOW the useless snippets...

      I guess I just I need to tweak my config to reorder them... and also use TAB to complete (instead of Enter)...

      ...and also figure out how to theme the menu so I don't get flashes of shocking pink while I'm trying to focus on the code ๐Ÿ˜‚

      In conversation Monday, 22-Nov-2021 01:29:28 UTC permalink

      Attachments


      1. https://media.mstdn.io/mstdn-media/media_attachments/files/107/318/100/183/382/331/original/7f16c30c57bb42aa.png
    • Bernie (codewiz@mstdn.io)'s status on Monday, 22-Nov-2021 02:31:12 UTC Bernie Bernie
      in reply to
      • eriol ๐Ÿฅ

      @eriol Thank you so much for sharing!

      In spite of all the sarcasm, I _do_ believe that #neovim is on the right path... we need to get rid of the awful VimL and give plugin writers a solid base to work on.

      Perhaps better integration will come in time... but we also need the developers to pick good defaults to avoid the paradox of choice.

      In conversation Monday, 22-Nov-2021 02:31:12 UTC permalink
    • eriol ๐Ÿฅ (eriol@pleroma.debian.social)'s status on Monday, 22-Nov-2021 02:31:24 UTC eriol 🍥 eriol ๐Ÿฅ
      in reply to
      @codewiz maybe you already know, but to tweak the order of completions you can use priority or just order sources as you want them. I chose the latter:
      https://noa.mornie.org/eriol/ansible-collection-dotfiles/src/branch/main/roles/neovim/files/config/nvim/lua/plugins/nvim-cmp.lua#L47-L56

      I also moved recently to neovim (I think about 3 week ago), and I don't know lua (yet!) but I decided to full switch, so my conf is only lua.
      In conversation Monday, 22-Nov-2021 02:31:24 UTC permalink

      Attachments

      1. ansible-collection-dotfiles
        from eriol
        ansible-collection-dotfiles
    • eriol ๐Ÿฅ (eriol@pleroma.debian.social)'s status on Monday, 22-Nov-2021 02:31:24 UTC eriol 🍥 eriol ๐Ÿฅ
      in reply to
      • eriol ๐Ÿฅ
      @codewiz please feel free to take a look if it can help you:
      https://noa.mornie.org/eriol/ansible-collection-dotfiles/src/branch/main/roles/neovim/files/config/nvim

      Ignore the ansible layer on top, it's only because I have more than one machine were I want my stuff and all the other systems I tried (from pure git of the HOME to handcrafted Makefile, to home management software) did not worked well at the end.
      In conversation Monday, 22-Nov-2021 02:31:24 UTC permalink

      Attachments

      1. ansible-collection-dotfiles
        from eriol
        ansible-collection-dotfiles
    • Bernie (codewiz@mstdn.io)'s status on Monday, 22-Nov-2021 04:37:13 UTC Bernie Bernie
      in reply to
      • eriol ๐Ÿฅ

      @eriol Hmm... I already had nvim_lsp as first entry in cmp.config.sources, so it must be something else.

      One difference between my configuration and yours is that I used vsnip instead of luasnip. I'll try switching, since I only really care about semantic completion with nvim_lsp at this time.

      By the way, your nvim config is *neat*! I can't believe you've been using it nly for 3 weeks.

      In conversation Monday, 22-Nov-2021 04:37:13 UTC permalink
    • Bernie (codewiz@mstdn.io)'s status on Monday, 22-Nov-2021 04:47:32 UTC Bernie Bernie
      in reply to
      • eriol ๐Ÿฅ

      @eriol Ah, after tweaking the menu appearance to show the completion source, I found out that those snippets were actually coming from rust-analyzer! ๐Ÿคฆ

      I still need to figure out how to remove them, but that's prograss...

      This is how I added the cool icons:
      https://github.com/hrsh7th/nvim-cmp/wiki/Menu-Appearance

      In conversation Monday, 22-Nov-2021 04:47:32 UTC permalink

      Attachments


      1. https://media.mstdn.io/mstdn-media/media_attachments/files/107/318/884/453/939/323/original/6127735685f87445.png
      2. Menu Appearance ยท hrsh7th/nvim-cmp Wiki
        A completion plugin for neovim coded in Lua. Contribute to hrsh7th/nvim-cmp development by creating an account on GitHub.
    • Srevin Saju (srevinsaju@mstdn.io)'s status on Monday, 22-Nov-2021 04:47:39 UTC Srevin Saju Srevin Saju
      in reply to

      @codewiz Yes! I use packer and the experience was really good for me. Since I use neovim as a ~ IDE and vim as a simple text editor, I did not want to share the configuration between both, so I kept one simple and one complex.

      This is in my *.anyshrc

      alias vi=vim
      alias vim=neovim

      In conversation Monday, 22-Nov-2021 04:47:39 UTC permalink
      Bernie repeated this.
    • Bernie (codewiz@mstdn.io)'s status on Monday, 22-Nov-2021 04:55:34 UTC Bernie Bernie
      in reply to
      • Srevin Saju

      @srevinsaju Thanks!

      In conversation Monday, 22-Nov-2021 04:55:34 UTC permalink
    • Srevin Saju (srevinsaju@mstdn.io)'s status on Monday, 22-Nov-2021 04:55:35 UTC Srevin Saju Srevin Saju
      in reply to

      @codewiz I would also consider https://nvchad.github.io/getting-started/learn-lua as an interesting and useful resource for anyone new to the world of lua ๐Ÿ˜„

      In conversation Monday, 22-Nov-2021 04:55:35 UTC permalink

      Attachments

      1. No result found on File_thumbnail lookup.
        Learning Lua | NvChad
        Note: This is a very basic lua tutorial to get you familiar with NvChad config
    • Srevin Saju (srevinsaju@mstdn.io)'s status on Monday, 22-Nov-2021 04:55:36 UTC Srevin Saju Srevin Saju
      in reply to

      @codewiz Adding on to the default plugins, I have lervag/vimtex, github/copilot.vim, and hashivim/vim-terraform

      In conversation Monday, 22-Nov-2021 04:55:36 UTC permalink
    • Srevin Saju (srevinsaju@mstdn.io)'s status on Monday, 22-Nov-2021 04:55:37 UTC Srevin Saju Srevin Saju
      in reply to

      @codewiz I used an out of the box configuration format so that I can get started with neovim with Lua faster!

      https://github.com/NvChad/NvChad

      It has most features and toolsets enabled by default, and also we can add our own custom configuration in a separate file, to make it modular.

      In conversation Monday, 22-Nov-2021 04:55:37 UTC permalink

      Attachments


    • Bernie (codewiz@mstdn.io)'s status on Monday, 22-Nov-2021 05:14:07 UTC Bernie Bernie
      in reply to
      • Srevin Saju
      • eriol ๐Ÿฅ

      @srevinsaju @eriol Could you please share the output of these commands on your vim?

      :hi Pmenu
      :hi PmenuSel
      :hi PmenuSbar
      :hi PmenuThumb

      I finally made my menu non-magenta, but I'm not good at matching colors...

      In conversation Monday, 22-Nov-2021 05:14:07 UTC permalink
    • Srevin Saju (srevinsaju@mstdn.io)'s status on Monday, 22-Nov-2021 05:15:48 UTC Srevin Saju Srevin Saju
      in reply to
      • eriol ๐Ÿฅ

      @codewiz @eriol

      Pmenu xxx ctermfg=0 ctermbg=13 guifg=#abb2bf guibg=#282c34

      PmenuSel xxx ctermfg=242 ctermbg=0 guifg=#353b45 guibg=#A3BE8C

      PmenuSbar xxx ctermbg=248 guibg=#353b45

      PmenuThumb xxx ctermbg=15 guibg=#81A1C1

      btw, that probably uses my also favorite One Dark Theme, and would probably look like this

      (PS: thats github copilot with the suggestions)

      In conversation Monday, 22-Nov-2021 05:15:48 UTC permalink

      Attachments


      1. https://media.mstdn.io/mstdn-media/media_attachments/files/107/319/009/844/947/920/original/faa7c523c82278c8.png
    • Bernie (codewiz@mstdn.io)'s status on Monday, 22-Nov-2021 05:23:16 UTC Bernie Bernie
      in reply to
      • Srevin Saju
      • eriol ๐Ÿฅ

      @srevinsaju @eriol Nope. Your color scheme gives me that ugly magenta background.

      It's color 13 in the xterm-256 palette:
      https://www.ditig.com/256-colors-cheat-sheet

      In conversation Monday, 22-Nov-2021 05:23:16 UTC permalink

      Attachments

      1. No result found on File_thumbnail lookup.
        256 Colors - Cheat Sheet - Xterm, HEX, RGB, HSL
        List of 256 colors for Xterm prompt (console). Contains displayed color, Xterm Name, Xterm Number, HEX, RGB and HSL codes.
    • Srevin Saju (srevinsaju@mstdn.io)'s status on Monday, 22-Nov-2021 05:29:44 UTC Srevin Saju Srevin Saju
      in reply to

      @codewiz Can you show the output of
      `:echo $TERM`

      ctermbg should actually be a fallback to guibg

      In conversation Monday, 22-Nov-2021 05:29:44 UTC permalink
    • Bernie (codewiz@mstdn.io)'s status on Monday, 22-Nov-2021 05:37:47 UTC Bernie Bernie
      in reply to
      • Srevin Saju

      @srevinsaju Oh, you probably have termguicolors set. I had to disable it because it made the text selection light gray. How did you override it?

      In conversation Monday, 22-Nov-2021 05:37:47 UTC permalink
    • Srevin Saju (srevinsaju@mstdn.io)'s status on Monday, 22-Nov-2021 05:45:14 UTC Srevin Saju Srevin Saju
      in reply to

      @codewiz right now, I have nvchad doing the theming for me, because when I tried manually theming every component myself, I started breaking a lot of UI stuff ๐Ÿ˜…

      In conversation Monday, 22-Nov-2021 05:45:14 UTC permalink

      Attachments


      1. https://media.mstdn.io/mstdn-media/media_attachments/files/107/319/123/946/007/259/original/ebf9b073fb380365.png
    • Bernie (codewiz@mstdn.io)'s status on Monday, 22-Nov-2021 06:30:36 UTC Bernie Bernie
      in reply to
      • Srevin Saju
      • eriol ๐Ÿฅ

      @srevinsaju @eriol And that's what's been happening to me ๐Ÿ˜ž

      I think I finally got it to work properly, but it wasn't easy nor fun:

      In conversation Monday, 22-Nov-2021 06:30:36 UTC permalink
    • Bernie (codewiz@mstdn.io)'s status on Monday, 22-Nov-2021 06:41:53 UTC Bernie Bernie
      in reply to
      • eriol ๐Ÿฅ

      @eriol Semantic completion in #neovim is starting to look and behave reasonably well, but I'm still getting those stupid snippets before the methods...

      Also, does LSP support assisted editing for function arguments?

      In conversation Monday, 22-Nov-2021 06:41:53 UTC permalink

      Attachments


      1. https://media.mstdn.io/mstdn-media/media_attachments/files/107/319/338/445/137/125/original/a43c5d48414bbf1c.png
    • Bernie (codewiz@mstdn.io)'s status on Monday, 22-Nov-2021 06:43:28 UTC Bernie Bernie
      in reply to
      • Srevin Saju
      • eriol ๐Ÿฅ

      @eriol @srevinsaju I've also hit a bug in lsp-config and reported it to them (their bug report template is quite good!):

      https://github.com/neovim/nvim-lspconfig/issues/1471

      In conversation Monday, 22-Nov-2021 06:43:28 UTC permalink
    • Bernie (codewiz@mstdn.io)'s status on Tuesday, 23-Nov-2021 07:14:03 UTC Bernie Bernie
      in reply to
      • Srevin Saju
      • eriol ๐Ÿฅ

      @eriol @srevinsaju It's the oh-my-zsh way... a pre-baked, well maintained, extensible config with reasonable defaults.

      In conversation Tuesday, 23-Nov-2021 07:14:03 UTC permalink
    • eriol ๐Ÿฅ (eriol@pleroma.debian.social)'s status on Tuesday, 23-Nov-2021 07:14:05 UTC eriol 🍥 eriol ๐Ÿฅ
      in reply to
      @codewiz I fully agree with you on VimL, and I also hope that we will avoid the paradox of choice. It can be fun configure you editor but maybe you just want to use it!
      Maybe as showed by srevinsaju@mstdn.io the way is to provide ready to go configs... I really don't know.
      In conversation Tuesday, 23-Nov-2021 07:14:05 UTC permalink
    • Bernie (codewiz@mstdn.io)'s status on Tuesday, 23-Nov-2021 07:19:53 UTC Bernie Bernie
      in reply to
      • Srevin Saju
      • eriol ๐Ÿฅ

      @eriol @srevinsaju My nvim-lspconfig bug was fixed in just 6 hours... great service, would buy again!

      #neovim #programming

      In conversation Tuesday, 23-Nov-2021 07:19:53 UTC permalink
    • Bernie (codewiz@mstdn.io)'s status on Tuesday, 23-Nov-2021 07:49:45 UTC Bernie Bernie
      in reply to
      • eriol ๐Ÿฅ

      @eriol It works! (and it took much less configuration than expected)

      In conversation Tuesday, 23-Nov-2021 07:49:45 UTC permalink

      Attachments


      1. https://media.mstdn.io/mstdn-media/media_attachments/files/107/325/277/696/522/344/original/367604efb303347d.png
    • eriol ๐Ÿฅ (eriol@pleroma.debian.social)'s status on Tuesday, 23-Nov-2021 07:49:46 UTC eriol 🍥 eriol ๐Ÿฅ
      in reply to
      @codewiz for LSP support of function signature, I found this https://github.com/ray-x/lsp_signature.nvim that seems to do what we want but I have not tried it yet.
      In conversation Tuesday, 23-Nov-2021 07:49:46 UTC permalink

      Attachments

      1. GitHub - ray-x/lsp_signature.nvim: LSP signature hint as you type
        LSP signature hint as you type. Contribute to ray-x/lsp_signature.nvim development by creating an account on GitHub.
    • Bernie (codewiz@mstdn.io)'s status on Thursday, 12-May-2022 17:53:22 UTC Bernie Bernie
      in reply to
      • nick

      @codingHahn Yes, but I don't remember how I did it.

      Probably by overriding the completion sources:

      sources = cmp.config.sources({
      { name = 'nvim_lsp' },
      }, {
      { name = 'vsnip' },
      })

      This is my complete neovim config (the Lua part):
      https://codewiz.org/pub/bernie.lua

      In conversation Thursday, 12-May-2022 17:53:22 UTC permalink

      Attachments


    • nick (codinghahn@chaos.social)'s status on Thursday, 12-May-2022 17:53:24 UTC nick nick
      in reply to

      @codewiz Hey, have you managed to fix the snippets ordering? I am struggling with the same problem and haven't found a solution yet.

      In conversation Thursday, 12-May-2022 17:53:24 UTC permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • Privacy
  • Source
  • Version
  • Contact

Bobinas P4G is a social network. It runs on GNU social, version 2.0.1-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Bobinas P4G content and data are available under the Creative Commons Attribution 3.0 license.