Made a simple plugin to auto write text as typed. Easily enable/disable/toggle autowriting for current buffer.

Hello vimmers πŸ‘‹

I made this mostly for myself this morning. But decided to quickly push it out as a plugin.
Trying to K.I.S.S and not over complicate the code.

You can just as easily copy the code from plugin/autowrite.vim into your own vim configs :)

Understand there also might be many plugins doing similar, but from my quick research some of them maybe didn't work, especially with newer vim distributions such as Neovim.

Get AutoWrite.vim here

πŸ‘︎ 26
πŸ’¬︎
πŸ‘€︎ u/beauwilliams
πŸ“…︎ Dec 17 2021
🚨︎ report
How do I make the command run change the current buffer instead of opening a new one.

For example, if I run M-x shell it opens a new buffer instead of changing the current buffer. The older version of emacs I used didn't do that.

πŸ‘︎ 5
πŸ’¬︎
πŸ“…︎ Dec 16 2021
🚨︎ report
bdelete closes neovim entirely, not just the current buffer

Hey all! I am new to neovim (have use vim in the past) but I decided to get a "fresh start" and not port my vim config over.

I'm currently using CosmicNvim along with Bufferline. I have bufferline configured to run `:bdelete! %d` as the close command, but event calling `:bdelete` directly has the same result: neovim is closed completely rather than just the current buffer.

I am not sure if this is just a misunderstanding of how it should work or not so I thought I'd ask some experts. Thanks in advance!

πŸ‘︎ 3
πŸ’¬︎
πŸ“…︎ Nov 15 2021
🚨︎ report
Neovim + LSP β€œ Error detected while processing CursorHoldI Autocommands for "*": method textDocument/codeAction is not supported by any of the servers registered for the current buffer”

This issue is happening to me on 2 language server I’ve tried, pyright and bash-language-server.. but not happening on yaml-language-server or sumneko_lua. How can I fix it?

  • When I create/open .zsh or .sh buffers, I get error on tittle of this post .

  • LSP shows bash-language-server attached:

    Language client log: /home/ec2-user/.cache/nvim/lsp.log~ Detected filetype: zsh
    ~ 1 client(s) attached to this buffer:
    ~ Client: bashls (id: 1, pid: 19321, bufnr: [1])
    ~ filetypes: sh, zsh
    ~ autostart: true
    ~ root directory: Running in single file mode.
    ~ cmd: /usr/bin/bash-language-server start

  • lsp log shows:

    [START][2021-12-06 00:07:13] LSP logging initiated
    2 [WARN][2021-12-06 00:08:44] .../lua/vim/lsp.lua:89> "method textDocument/codeAction is not supported by any of the servers registered for the current buffer"

  • As an attempt tp troubleshoot, I added this code on my configuration:

        4   if client.resolved_capabilities.code_action then                                                                   
        3     print("codeAction present")                                                                                      
        2   else                                                                                                               
        1     print("No codeAction")                                                                                           
    

    ο ΄ 52 end ο ΄

  • .. and nvim prints β€œNo codeAction”.

  • What can I do?

Some details of my setup:

  • Versions

    NVIM v0.7.0-dev+672-g1e6eeca9d

... keep reading on reddit ➑

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/manwesu
πŸ“…︎ Dec 06 2021
🚨︎ report
Does anyone have a codesnippet for getting all available code_actions in the current buffer?

is that even possible with the LSP protocol?

πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/geckothegeek42
πŸ“…︎ Oct 08 2021
🚨︎ report
This is the current high score apes, I won’t be stopping until this score is crushed and there is a considerable buffer for anyone to beat the GME high score
πŸ‘︎ 1k
πŸ’¬︎
πŸ“…︎ May 02 2021
🚨︎ report
My current DIY PowerDAC - 16/384 DAC with 8W tube buffer. More details in comments. reddit.com/gallery/o6qdcy
πŸ‘︎ 231
πŸ’¬︎
πŸ‘€︎ u/dr_Bar-mental
πŸ“…︎ Jun 24 2021
🚨︎ report
Why the COP26 climate summit will be both crucial and disappointing " In the long term it is necessary that fossil fuels become increasingly expensive, but peaks and volatility are destructive. Governments need to build more buffers into the current system as well as hasten alternatives." economist.com/leaders/202…
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/solar-cabin
πŸ“…︎ Oct 29 2021
🚨︎ report
[WTS] [US-SC] [H]iBasso PB2 With Dedicated External Battery PSU, LME 49990 Op Amps + High Current Buffers & Solid Silver Interconnects [W] PayPal ($325)
πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/Mshenay
πŸ“…︎ Sep 01 2021
🚨︎ report
Bufferline: How to Only Show Tabs and Not Buffers That Are Within the Current Tab?

The title is probably confusing as I am not entirely sure how to ask this. I use the bufferline plugin to get a more modern looking tabline, but am having two annyounces.

The first is that bufferline will show spits in the tab list. So if I am in one file and open a split of another the split will then be shown in the tabline. This often confuses me and I would rather only show tabs. Does bufferline support this?

The second question is actually about how buffers work themselves. I have noticed that if I open neovim, open a file, then q and move to another file I will see that last opened file in bufferline. I believe this is due to some server neovim runs, but this often makes is hard for me to manage projects in neovim. How can I disable this behavior?

πŸ‘︎ 9
πŸ’¬︎
πŸ‘€︎ u/FOSSilized_D43mon
πŸ“…︎ Aug 01 2021
🚨︎ report
My current DIY PowerDAC - a tube amp with digital inputs only. 8W tube buffer, 16bit/384kHz R-2R DAC with feedback-free and filter-free topology. reddit.com/gallery/o6p9fi
πŸ‘︎ 61
πŸ’¬︎
πŸ‘€︎ u/dr_Bar-mental
πŸ“…︎ Jun 24 2021
🚨︎ report
Could a buffer produce too much current for a circuit?

I'm trying to get this concept of a buffer straight. It is my understanding that power supply amperage ratings are basically the amount of current they can supply at a given voltage. If you are driving a load at a certain voltage, the load can take up to the rated amp. For buffers, they take a signal of a certain voltage and can up the amps at the same voltage. If I have a load in the circuit, could the buffer produce too much amp and kill the load, so to speak? Or does the load only take what it needs?

πŸ‘︎ 3
πŸ’¬︎
πŸ“…︎ Jul 28 2021
🚨︎ report
SLPT: If for whatever reason you quit your job or never returned the next day, then later feel bad about it since finding a new job you like (especially if your boss was nice). Just send him/her a letter of apology with a gift card from your current workplace. Should buffer out your resume a bit. πŸ‘

....Thank me later! 😁

Note: Keeping in mind it being especially a competitor's business. (Restaurant, etc).

πŸ‘︎ 12
πŸ’¬︎
πŸ‘€︎ u/TechNerd76
πŸ“…︎ Sep 12 2021
🚨︎ report
LSP: How do I clear the diagnostic cache of the current buffer?

Hi there! Sorry if this is obvious - I'm reading through the man pages and I can't seem to figure out how to do this.

I'm having issues with stale diagnostics in a large repo. To reset diagnostics, I use :LspRestart<CR>:e<CR>, as suggested in the docs. This works, but it doesn't clear the cache. In my particular use case, I use Lspsaga keybindings which hook into vim.lsp.diagnostic.get_next(). After resetting the LSP server, the get_next() keybindings still have access to the stale diagnostics.

I found the vim.lsp.diagnostic.reset(), which looks like exactly what I need, but I'm not sure how to get the correct parameters. Ideally I can just add this to the same keybinding which restarts LSP for me. Any thoughts?

thank you!

πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/fitzchivalrie
πŸ“…︎ Sep 02 2021
🚨︎ report
What do you call a unity gain current buffer?

An amp per amp amp.

πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/TotallyAUsername
πŸ“…︎ Jun 24 2021
🚨︎ report
helm-pages: A Helm data source for pages in the current buffer github.com/david-christia…
πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/fakecreditcard
πŸ“…︎ Aug 22 2021
🚨︎ report
My current work in progress any recommendations for a adjustable stock? I’d prefer to stay away from a buffer tube
πŸ‘︎ 22
πŸ’¬︎
πŸ‘€︎ u/Letsgetsomepussy
πŸ“…︎ Apr 12 2021
🚨︎ report
[Question] Please help. The bandwidth graph is showing datarates upto 3gbps and I also have high cpu usage when this happens which causes high battery drain. The readahead also keeps jumping which sometimes causes the video to buffer. Can this be fixed in the current version?
πŸ‘︎ 7
πŸ’¬︎
πŸ“…︎ Jun 22 2021
🚨︎ report
Can I expand the file name in the current buffer?

When editing a file, is there a way to insert the name of the file into the buffer?
Is it also possible to do the same for:

  • The file folder
  • The working directory (pwd in command mode)
  • The absolute file path
  • The file path relative to the working directory
πŸ‘︎ 2
πŸ’¬︎
πŸ“…︎ May 24 2021
🚨︎ report
Current Team any advice if I should swap gogo for gigi, izumi, or enzo? Is that a good swap? Multi damage gogo for a buffer
πŸ‘︎ 8
πŸ’¬︎
πŸ‘€︎ u/hnguyen03
πŸ“…︎ Apr 20 2021
🚨︎ report
Coming back to the game after a long time; Is there a solid buffer/debuffer in the current mod?

Played way back in mod 10 with friends, but I kinda want to play a buffer/debuffer class instead of a basic "only do DPS" class. My girlfriend is going to be playing a devoted cleric, and I've seen mention of warlock being a little okay since the buff/debuff nerfs in mod 17(?). Is this still true? What's the best buffing/debuffing class?

πŸ‘︎ 12
πŸ’¬︎
πŸ‘€︎ u/ShadoKitty
πŸ“…︎ Mar 20 2021
🚨︎ report
Code feedback: Update a YAML frontmatter attribute in the current buffer

I was searching for a function that would update the timestamp of the updated_at key in the YAML frontmatter of my blog posts and wiki entries and stuff.

I didn't find any convenience helper that would let me operate on YAML frontmatter data, so I hacked together a function that

  1. Looks for a YAML frontmatter block; if none is found just dump the attribute at the top of the document.
  2. Looks for an updated_at key inside the frontmatter; if none is found, just dump the attribute at the end of the YAML frontmatter block.
  3. Insert the new timestamp at the attribute location.

The result wasn't super hard to figure out (ok it took way longer than I would've liked but less long than I had feared), but I find the nested ifs and the search-forward and looking-at calld to be a bit all over the place.

How would you approach writing a pattern finder like that with Emacs Lisp? Suggestions are very welcome!

And you can all use this function, of course.

(defun ct/yaml/update-post ()
  "Insert or update an updated_at attribute in the buffer's YAML frontmatter, or insert a frontmatter block if none exists."
  (interactive)
  (defun _timestamp ()
    (format-time-string "%Y-%m-%d %H:%M:%S +0100"))
  (save-excursion
    (goto-char (point-min))
    ;; Find the YAML frontmatter block boundaries, ignoring (optional) beginning of the block.
    (when (looking-at-p "^---") (forward-line +1))
    (let ((target-pos (point))
          (yaml-end-pos (search-forward-regexp "^---" nil t)))
      (if (not yaml-end-pos)
          ;; No YAML block, yet; insert a new one
          (progn
                (goto-char target-pos)
                (insert "updated_at: " (_timestamp)) (newline)
                (insert "---") (newline))
        ;; If YAML block is found, update or insert the date entry
        (progn
          (goto-char target-pos)
          (if (search-forward-regexp "^updated_at:" yaml-end-pos t)
              (progn 
                (kill-line) ;; point is after the ':' value separator b/c of search-forward
                (insert " " (_timestamp)))
            (progn
              (goto-char yaml-end-pos)
              (beginning-of-line)
              (insert "updated_at: " (_timestamp))
              (newline))))))))
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/divinedominion
πŸ“…︎ May 18 2021
🚨︎ report
Best way to get current buffer content as a Lua string?

I've been using this function, but I wonder if there's a more straightforward method that I'm overlooking (especially since I'd like to avoid the table to string conversion):

local buffer_to_string = function()
    local content = vim.api.nvim_buf_get_lines(0, 0, vim.api.nvim_buf_line_count(0), false)
    return table.concat(content, "\n")
end
πŸ‘︎ 4
πŸ’¬︎
πŸ“…︎ Apr 13 2021
🚨︎ report
How can I enable/disable certain things like mappings depending on what filetype the current working buffer is when switching between buffers?

What I'm trying to do is, say I have 2-4 splits with each file being a different filetype like a .c or .py file, when I switch between each buffer split can I configure it so that when I switch to a certain buffer to edit, it will detect what type of file it is and do whatever I had it set up like enabling/disabling a mapping? I've tried before with autocmd and FileType and a couple of Buffer events but haven't been successful.

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/DOMINATORLORD9872
πŸ“…︎ Mar 21 2021
🚨︎ report
Part 2.1 of 60 dollar gun rebuild. The buffer tube is going in once I get a new receiver because my current receiver isn't compatible with it.
πŸ‘︎ 50
πŸ’¬︎
πŸ‘€︎ u/fishyfrodo
πŸ“…︎ Jan 07 2021
🚨︎ report
Current build. I switched the fuzzes and overdrives already as I heard these fuzzes don't like buffers. Also, question - I've been using garageband amp sims and thinking about investing in some neural DSP or getting an iridium. Which would be better for running this board?
πŸ‘︎ 17
πŸ’¬︎
πŸ‘€︎ u/thesadcryer
πŸ“…︎ Jan 28 2021
🚨︎ report
How to save current buffer in lua?

I am trying to map a function key to save the current buffer to disk but I can not find the lua api to do it. I imagined it would look like this in init.vim:

map <F24> <cmd>lua vim.api.save_buffer(0)<CR>

I went through the api documentation and it does not say anything about saving.Can anybody help?

Edit: Found it, this seems to work:

nnoremap <F13> <cmd> lua vim.api.nvim_command('write')<CR>

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/sfarmapiatra
πŸ“…︎ Feb 20 2021
🚨︎ report
Current Goal: Create the Ultimate De/Buffer Army
πŸ‘︎ 44
πŸ’¬︎
πŸ‘€︎ u/Arknightlock
πŸ“…︎ Aug 05 2020
🚨︎ report
theme-anchor: Apply a custom theme to current Emacs buffer only github.com/GongYiLiao/the…
πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/negativeoilprice
πŸ“…︎ Mar 25 2021
🚨︎ report
Automatically moving to the top line of the current buffer

Hi there folks,

When using vanilla Emacs I had a function binded to a combination of keys to automatically scrolling up the current buffer so that the first line became the one where I had the point. This was great to access a whole view of eg a function whose first line was where the point was currently located. The best I do now is just centering the view with C-l

Is there anyway (or even a function to provide in my config.el) to provide the same functionality?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Phovox
πŸ“…︎ Jan 14 2021
🚨︎ report
fzf.vim paste selected filename into current buffer

Currently I have this which works but the cursor gets moved in the current buffer

let g:fzf_action = {
  \ 'ctrl-t': 'tab split',
  \ 'ctrl-x': 'split',
  \ 'ctrl-v': 'vsplit',
  \ 'ctrl-o': ':r !echo',
  \ }

When pressing ctrl-o in the window it works for example for :Files but when I do :Rg the filename is read into the buffer as well but the cursor in the buffer is moved to the top of the file.

Someone has a solution for stopping the cursor from moving in the buffer?

πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/Jeettek
πŸ“…︎ Feb 02 2021
🚨︎ report
Bias FZF file finder results to the directory of your current buffer balatero.com/writings/vim…
πŸ‘︎ 53
πŸ’¬︎
πŸ‘€︎ u/dbalatero
πŸ“…︎ Aug 30 2020
🚨︎ report
Plot all tables in the current buffer

Hi,

I am trying to do a function that:

a) Refresh all tables in my buffer (Easy with org-table-recalculate-buffer-tables)

b) Regenerate all GNUPLOT graphs associated with each table

c) Refresh corresponding inline images in the buffer (easy with org-redisplay-inline-images)

However, I am not able to see how to do b): for each table in the buffer I would like to generate again the GNUPlot PNG. How can I do that?

My current function:

;; Refresh tables and graphs

(defun my/refresh-tables-and-graphs()

(interactive)

(org-table-recalculate-buffer-tables)

(org-display-inline-images)

(org-redisplay-inline-images))

(global-set-key (kbd "<f8>") 'my/refresh-tables-and-graphs)

Many thanks!

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Carbone_
πŸ“…︎ Jan 23 2021
🚨︎ report
is it possible to open floaterm in cwd of current buffer?

id like to know if its possible that floaterm doesnt open always in the home directory but rather in the current working directory of the buffer im currently working on.

im asking this specifically because of git. id like to be able to commit changes on the fly without much hassle (switching to needed dir first).

ive fugitive installed but whe im in a buffer and enter :git add filename of current file i get an error message. so thats not a possibility right now (or ive set it up wrong). if possible id like to avoid other programs like lazygit or other git helpers.

so if possible id either be able to simply add a command directly from via in the terminal or open floaterm in cwd.

maybe someone here has an idea.

oh- i forgot. right now i simply open and close it via let g:floaterm_keymap_toggle = '<F1>'

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Joe23rep
πŸ“…︎ Dec 20 2020
🚨︎ report
How to get a list of buffers in current tab

Hi everyone, I’m trying so hard to get a list if buffers in current tab, is there a way todo thst. Thanks

πŸ‘︎ 12
πŸ’¬︎
πŸ‘€︎ u/jamJam20
πŸ“…︎ Oct 11 2020
🚨︎ report
Any useful plugin that show buffer tabs only in current tab?

Hi there, am looking for a way to show current buffer tabs only in current tab. I tend to used tabs as workspace.

Thanks

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/jamJam20
πŸ“…︎ Oct 06 2020
🚨︎ report
Current Sensor buffer or??

I'm in Power Systems and haven't thought about small signal devices in quite some time. I purchased a very good revenue grade power meter to monitor and control my own power consumption. I already have revenue grade (0.5%) current transformers installed in my breaker box and would like to use these.

My meter (Ebay) has inputs for current sensors, not current transformers (see attached spec). My first thought was to place a 2 Ohm, 50W resistor across the CT secondary. The V=I*R part worked, but the meter didn't register properly nor was change linear. BTW I test power meters and complex protection devices as a part of my job and have a 3 phase power system simulator at my desk. Our devices are generally 0-120V & 0-100A into the meter. What I'm saying is that offsets ratio correction factors, I'm used to dealing with.

When I contacted the meter manufacturer, they advised my that the meter 1 Meg input impedance would cause trouble with the CT-resistor I had first envisioned. The manufacturer refers to the current sensors as "Low Energy Analog" devices.

I've found that even if I inject a small AC voltage (1-10) from test set, I do not get reasonable values.

Is there and op amp circuit or buffer I can cobble together to enable my existing, installed CT's to drive the input?

Device is a SEL-734B, which was designed for MV capacitor control, but its really a SEL-734 revenue meter with a slightly different analog input board.

Thanks!

https://preview.redd.it/cv6ffaelyye61.jpg?width=540&format=pjpg&auto=webp&s=cd375ffc124d00eb5e4702d5719b8bcedc72d6ae

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/HV_Commissioning
πŸ“…︎ Feb 02 2021
🚨︎ report
Who do you Prefer? Michael Buffer(current) vs Jimmy Lennon Jr (current)

Michael was good for a while but he’s past it these days, would probs only be a 3 division world champ. Lennon on the other hand is still in his prime and is probs a 6/7 division world champ.

View Poll

πŸ‘︎ 9
πŸ’¬︎
πŸ‘€︎ u/pianolime
πŸ“…︎ May 26 2020
🚨︎ report
I'am trying to make a custom command to substitute to all files of the current working directory in the current buffer file type

so far I have this

function! Dir_subsitute(arg1, arg2)
  argadd **/*.<c-r>=expand('%:e')
  argdo %s/arg1/arg2/gec
endfunction

command -nargs=\* Sub execute 'call Dir_subsitute(<f-args>)'

:Sub function fun But its not working I can't get the arguments working
It things I have sent
:Sub arg1 arg2

πŸ‘︎ 18
πŸ’¬︎
πŸ‘€︎ u/banana_llarma
πŸ“…︎ Sep 30 2020
🚨︎ report

Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.