Skip to content

Commit

Permalink
Merge pull request #4 from timchurchard/dependabot/docker/ubuntu-24.04
Browse files Browse the repository at this point in the history
Bump ubuntu from 23.10 to 24.04
  • Loading branch information
timchurchard authored Jun 28, 2024
2 parents 1dd5301 + c0e0171 commit bdb2be8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
20 changes: 8 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# timchurchard/ide IDE for golang with neovim in docker
FROM ubuntu:23.10
FROM ubuntu:24.04

# Install system tools
RUN apt-get update -y && apt-get upgrade -y && \
Expand Down Expand Up @@ -41,8 +41,8 @@ RUN apt install -y python3 python3-venv && \
ENV PATH=$PATH:/opt/venv/bin

# Install neovim: https://github.com/neovim/neovim/wiki/Installing-Neovim
ENV VIM_COMMIT=v0.9.5
RUN apt install -y lua-nvim luajit ruby-dev && \
ENV VIM_COMMIT=v0.10.0
RUN apt install -y luajit ruby-dev && \
apt remove neovim neovim-runtime neovim-qt && \
git clone https://github.com/neovim/neovim.git neovim.git && \
cd neovim.git && \
Expand All @@ -62,8 +62,8 @@ RUN apt install -y ripgrep fd-find
RUN apt-get autoclean -y && apt-get autoremove -y && apt-get clean -y

# Install golang
ENV GOLANG_URL=https://golang.org/dl/go1.21.7.linux-amd64.tar.gz
ENV GOLANG_SHA256=13b76a9b2a26823e53062fa841b07087d48ae2ef2936445dc34c4ae03293702c
ENV GOLANG_URL=https://golang.org/dl/go1.21.11.linux-amd64.tar.gz
ENV GOLANG_SHA256=54a87a9325155b98c85bc04dc50298ddd682489eb47f486f2e6cb0707554abf0

RUN curl -o golang.tgz -L ${GOLANG_URL} && \
echo "$GOLANG_SHA256 golang.tgz" > golang.tgz.sha256 && \
Expand Down Expand Up @@ -159,13 +159,9 @@ COPY files/coc-settings.json .config/nvim/

RUN zsh -c ". $NVM_DIR/nvm.sh && cd ~/.config/nvim/plugged/coc.nvim && npm ci"

RUN echo ':PlugInstall' > /tmp/gib.txt && \
echo ':GoInstallBinaries' >> /tmp/gib.txt && \
echo ':TSInstall go' >> /tmp/gib.txt && \
echo ':q' >> /tmp/gib.txt && \
echo ':q' >> /tmp/gib.txt && \
echo ':q' >> /tmp/gib.txt && \
zsh -c ". $NVM_DIR/nvm.sh && nvim -s /tmp/gib.txt"
RUN nvim +:PlugInstall +:qa \
nvim +:GoInstallBinaries +:qa \
nvim "+:TSInstall go" +:qa

# Copy in final bits for /opt
COPY files/entrypoint.sh /opt/
Expand Down
8 changes: 4 additions & 4 deletions files/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ let g:terraform_fmt_on_save=1
let g:terraform_align=1

" gofmt on save
autocmd BufWritePre *.go :silent! lua require('go.format').goimport()
autocmd BufWritePre *.go :silent! lua require('go.format').goimports()

" Auto start NERD tree when opening a directory
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NvimTreeToggle' argv()[0] | wincmd p | ene | wincmd p | endif
Expand Down Expand Up @@ -243,9 +243,9 @@ require("toggleterm").setup{
}

require 'go'.setup({
goimport = 'gopls', -- if set to 'gopls' will use golsp format
goimports = 'gopls', -- if set to 'gopls' will use golsp format
gofmt = 'gopls', -- if set to gopls will use golsp format
max_line_len = 160,
--max_line_len = 160,
tag_transform = false, -- gomodifytag overwrite eg snakecase camelcase
test_dir = '',
comment_placeholder = ' ',
Expand All @@ -258,7 +258,7 @@ require 'go'.setup({
cfg = {...} -- add you config here
require "lsp_signature".setup(cfg)

require("go.format").goimport() -- goimport + gofmt
require("go.format").goimports() -- goimport + gofmt

local protocol = require'vim.lsp.protocol'

Expand Down

0 comments on commit bdb2be8

Please sign in to comment.